@gaelmotte/gmotte-sfdx-plugin v0.4.0
@gaelmotte/gmotte-sfdx-plugin
Personal sfdx plugin to ease my everyday life
- @gaelmotte/gmotte-sfdx-plugin
- Debugging your plugin
- GitFlow
<!-- install --> <!-- usage -->
$ npm install -g @gaelmotte/gmotte-sfdx-plugin
$ sfdx COMMAND
running command...
$ sfdx (--version)
@gaelmotte/gmotte-sfdx-plugin/0.4.0-alpha.3 linux-x64 node-v19.0.0
$ sfdx --help [COMMAND]
USAGE
$ sfdx COMMAND
...
sfdx gmotte:org:switch [-g] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
Interractively switch default username and default devhub
USAGE
$ sfdx gmotte:org:switch [-g] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
FLAGS
-g, --global Set the configuration variables
globally, so they can be used from
any Salesforce DX project.
--json format output as json
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
this command invocation
DESCRIPTION
Interractively switch default username and default devhub
EXAMPLES
$ sfdx gmotte:org:switch
$ sfdx gmotte:org:switch -g
See code: src/commands/gmotte/org/switch.ts
Debugging your plugin
We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the .vscode
directory of this plugin is a launch.json
config file, which allows you to attach a debugger to the node process when running your commands.
To debug the gmotte:org:switch
command:
- Start the inspector
If you linked your plugin to the sfdx cli, call your command with the dev-suspend
switch:
$ sfdx gmotte:org:switch --dev-suspend
Alternatively, to call your command using the bin/run
script, set the NODE_OPTIONS
environment variable to --inspect-brk
when starting the debugger:
$ NODE_OPTIONS=--inspect-brk bin/run gmotte:org:switch
- Set some breakpoints in your command code
- Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
- In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen.
- Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
- Hit the green play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5). Congrats, you are debugging!
GitFlow
document me
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago