From e0aa271acf1142ba6c1fe77a9f5d4943ae740ccf Mon Sep 17 00:00:00 2001 From: Cristian Dominguez <6853656+cristiand391@users.noreply.github.com> Date: Mon, 22 Jan 2024 12:30:45 -0300 Subject: [PATCH] fix(retrieve): improve source-tracking err message (#882) * fix(retrieve): improve source-tracking err message * chore: revert link-check change * Apply suggestions from code review Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --------- Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com> --- messages/retrieve.start.md | 11 +++++++++++ src/commands/project/retrieve/start.ts | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/messages/retrieve.start.md b/messages/retrieve.start.md index 6108b8a0..dfcad166 100644 --- a/messages/retrieve.start.md +++ b/messages/retrieve.start.md @@ -192,3 +192,14 @@ The retrieve target directory [%s] overlaps one of your package directories. Spe # wantsToRetrieveCustomFields Because you're retrieving one or more CustomFields, we're also retrieving the CustomObject to which it's associated. + +# noSourceTracking + +Unable to track changes in your source files. +This command expects the org to support source tracking. If it doesn't, you must specify the metadata you want to retrieve. + +# noSourceTracking.actions + +- Use the `--source-dir`, `--manifest` or `--package-name` flags to retrieve metadata in source format. + +- Use the `--target-metadata-dir` flag to retrieve metadata in metadata format to a directory. diff --git a/src/commands/project/retrieve/start.ts b/src/commands/project/retrieve/start.ts index 99374b56..d31518e4 100644 --- a/src/commands/project/retrieve/start.ts +++ b/src/commands/project/retrieve/start.ts @@ -359,6 +359,13 @@ const buildRetrieveAndDeleteTargets = async ( !flags['package-name']?.length; if (isChanges) { + if (!(await flags['target-org'].supportsSourceTracking())) { + throw new SfError( + messages.getMessage('noSourceTracking'), + 'noSourceTracking', + messages.getMessages('noSourceTracking.actions') + ); + } const stl = await SourceTracking.create({ org: flags['target-org'], project: await SfProject.resolve(),