Skip to content

Commit c2f5ac9

Browse files
fix: optionally subscribe to SDR events, rather than optionally creating STL
1 parent cbc3d54 commit c2f5ac9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/utils/deploy.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export async function buildComponentSet(opts: Partial<DeployOptions>, stl?: Sour
8787
return cs;
8888
}
8989

90-
return ComponentSetBuilder.build({
90+
const x = await ComponentSetBuilder.build({
9191
apiversion: opts['api-version'],
9292
sourceapiversion: await getSourceApiVersion(),
9393
sourcepath: opts['source-dir'],
@@ -104,6 +104,7 @@ export async function buildComponentSet(opts: Partial<DeployOptions>, stl?: Sour
104104
...(opts.metadata ? { metadata: { metadataEntries: opts.metadata, directoryPaths: await getPackageDirs() } } : {}),
105105
projectDir: stl?.projectPath,
106106
});
107+
return x;
107108
}
108109

109110
export async function executeDeploy(
@@ -143,17 +144,14 @@ export async function executeDeploy(
143144
} else {
144145
// instantiate source tracking
145146
// stl will decide, based on the org's properties, what needs to be done
146-
let stl: SourceTracking | undefined;
147-
if (!opts['dry-run'] || !(await org.tracksSource())) {
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-
}
147+
const stl = await SourceTracking.create({
148+
org,
149+
// mdapi format deploys don't require a project, but at this point we need one
150+
project: project ?? (await SfProject.resolve()),
151+
subscribeSDREvents: !opts['dry-run'] || !(await org.tracksSource()),
152+
ignoreConflicts: opts['ignore-conflicts'],
153+
});
154+
registry = stl.registry;
157155

158156
componentSet = await buildComponentSet(opts, stl);
159157
if (componentSet.size === 0) {

0 commit comments

Comments
 (0)