diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24bdcd1b..68b4e3e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,8 @@ We encourage the developer community to contribute to this repository. This guid - [Node](https://nodejs.org/) >= 14 - [yarn](https://yarnpkg.com/) >= 1.22.5 +- [Code Climate](https://github.com/codeclimate/codeclimate) (If you are on MacOS, you will need Xcode Command Line Tools) +- [Docker](https://docs.docker.com/get-docker/) (Needed by Code Climate) ## Installation diff --git a/README.md b/README.md index 619d6e5e..bc0622d4 100644 --- a/README.md +++ b/README.md @@ -130,16 +130,16 @@ If you run your CI/CD jobs inside a Docker image, you can add the plugin to your ## How to use it? -* [`sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-sgdsourcedelta--f-string--t-string--r-filepath--i-filepath--d-filepath--s-filepath--w--o-filepath--a-number--d--n-filepath--n-filepath---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +* [`sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [-S] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-sgdsourcedelta--f-string--t-string--r-filepath--i-filepath--d-filepath--s-filepath--w--o-filepath--a-number--d--n-filepath--n-filepath--s---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) -## `sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` +## `sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] [-o ] [-a ] [-d] [-n ] [-N ] [-S] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` Generate the sfdx content in source format and destructive change from two git commits ``` USAGE $ sfdx sgd:source:delta -f [-t ] [-r ] [-i ] [-D ] [-s ] [-W] - [-o ] [-a ] [-d] [-n ] [-N ] [--json] [--loglevel + [-o ] [-a ] [-d] [-n ] [-N ] [-S] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -149,6 +149,9 @@ OPTIONS -N, --include-destructive=include-destructive file listing paths to explicitly include for any destructive actions + -S, --silent does not display result in + stdout/stderr + -W, --ignore-whitespace ignore git diff whitespace (space, tab, eol) changes diff --git a/messages/delta.js b/messages/delta.js index a593b190..bc6d23c6 100644 --- a/messages/delta.js +++ b/messages/delta.js @@ -17,4 +17,5 @@ module.exports = { includeFlag: 'file listing paths to explicitly include for any diff actions', includeDestructiveFlag: 'file listing paths to explicitly include for any destructive actions', + silentFlag: 'does not display result in stdout/stderr', } diff --git a/src/commands/sgd/source/delta.ts b/src/commands/sgd/source/delta.ts index 5ecd5374..5bed7f67 100644 --- a/src/commands/sgd/source/delta.ts +++ b/src/commands/sgd/source/delta.ts @@ -74,6 +74,10 @@ export default class SourceDeltaGenerate extends SfdxCommand { char: 'N', description: messages.getMessage('includeDestructiveFlag'), }), + 'silent': flags.boolean({ + char: 'S', + description: messages.getMessage('silentFlag'), + }), } public async run(): Promise { @@ -104,7 +108,9 @@ export default class SourceDeltaGenerate extends SfdxCommand { output.error = err.message process.exitCode = 1 } - this.ux.log(JSON.stringify(output, null, 2)) + if (!output.success || !this.flags.silent) { + this.ux.log(JSON.stringify(output, null, 2)) + } return output } }