diff --git a/command-snapshot.json b/command-snapshot.json index fe02daf2..6a05a526 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -79,7 +79,7 @@ "command": "project:deploy:preview", "flagAliases": [], "flagChars": ["c", "d", "m", "o", "x"], - "flags": ["ignore-conflicts", "json", "manifest", "metadata", "source-dir", "target-org"], + "flags": ["ignore-conflicts", "json", "manifest", "metadata", "source-dir", "target-org", "concise"], "plugin": "@salesforce/plugin-deploy-retrieve" }, { diff --git a/messages/deploy.metadata.preview.md b/messages/deploy.metadata.preview.md index f9164008..5dfa3c49 100644 --- a/messages/deploy.metadata.preview.md +++ b/messages/deploy.metadata.preview.md @@ -76,7 +76,7 @@ This flag applies only to orgs that allow source tracking. It has no effect on o # flags.concise.summary -Omit ignored files. +Show only the changes that will be deployed; omits files that are forceignored. # flags.api-version.summary diff --git a/src/commands/project/deploy/preview.ts b/src/commands/project/deploy/preview.ts index d39afcec..14048e4d 100644 --- a/src/commands/project/deploy/preview.ts +++ b/src/commands/project/deploy/preview.ts @@ -58,6 +58,10 @@ export default class DeployMetadataPreview extends SfCommand { summary: messages.getMessage('flags.target-org.summary'), required: true, }), + concise: Flags.boolean({ + summary: messages.getMessage('flags.concise.summary'), + default: false, + }), }; public async run(): Promise { @@ -88,7 +92,7 @@ export default class DeployMetadataPreview extends SfCommand { }); if (!this.jsonEnabled()) { - printTables(output, 'deploy'); + printTables(output, 'deploy', flags.concise); } return output; } diff --git a/test/nuts/tracking/forceIgnore.nut.ts b/test/nuts/tracking/forceIgnore.nut.ts index 35e2de16..8c739ebd 100644 --- a/test/nuts/tracking/forceIgnore.nut.ts +++ b/test/nuts/tracking/forceIgnore.nut.ts @@ -193,7 +193,7 @@ describe('forceignore changes', () => { expect(pullOutput?.files.length).to.equal(0); }); - it('will not display ignored files with --concise', () => { + it('will not display retrieved ignored files with --concise', () => { // gets file into source tracking const output = execCmd('project:retrieve:preview --concise', { ensureExitCode: 0, @@ -201,5 +201,16 @@ describe('forceignore changes', () => { expect(output).to.not.include("These files won't retrieve because they're ignored by your .forceignore file."); expect(output).to.not.include('ApexClass CreatedClass'); }); + + it('will not display deployed ignored files with --concise', async () => { + const newForceIgnore = originalForceIgnore + '\n' + `${classdir}/IgnoreTest.cls*`; + await fs.promises.writeFile(path.join(session.project.dir, '.forceignore'), newForceIgnore); + + const output = execCmd('deploy:metadata --json', { + ensureExitCode: 0, + }).jsonOutput?.result; + expect(output).to.not.include("These files won't deploy because they're ignored by your .forceignore file."); + expect(output?.status).to.equal('Nothing to deploy'); + }); }); });