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(),