Skip to content

Commit b60449d

Browse files
chore: revise approach
1 parent cd8b35e commit b60449d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/utils/deploy.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,18 @@ export async function executeDeploy(
143143
} else {
144144
// instantiate source tracking
145145
// stl will decide, based on the org's properties, what needs to be done
146-
const stl = await SourceTracking.create({
147-
org,
148-
// mdapi format deploys don't require a project, but at this point we need one
149-
project: project ?? (await SfProject.resolve()),
150-
subscribeSDREvents: opts['dry-run'] ? false : true,
151-
ignoreConflicts: opts['ignore-conflicts'],
152-
});
153-
registry = stl.registry;
146+
let stl: SourceTracking | undefined;
147+
if (!opts['dry-run'] || !(await org.supportsSourceTracking())) {
148+
stl = await SourceTracking.create({
149+
org,
150+
// mdapi format deploys don't require a project, but at this point we need one
151+
project: project ?? (await SfProject.resolve()),
152+
subscribeSDREvents: true,
153+
ignoreConflicts: opts['ignore-conflicts'],
154+
});
155+
registry = stl.registry;
156+
}
157+
154158
componentSet = await buildComponentSet(opts, stl);
155159
if (componentSet.size === 0) {
156160
if (opts['source-dir'] ?? opts.manifest ?? opts.metadata ?? throwOnEmpty) {

0 commit comments

Comments
 (0)