Skip to content

Commit 5c6d1c5

Browse files
committed
fix: remove expectation that sf will exist alongside sfdx npm installs
1 parent a960cc7 commit 5c6d1c5

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/commands/cli/install/test.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,15 @@ class Npm extends Method.Base {
269269

270270
private test(): Record<CLI, boolean> {
271271
const results = {} as Record<CLI, boolean>;
272-
for (const cli of this.getTargets()) {
273-
const executable =
274-
this.options.cli === CLI.SFDX && cli === CLI.SF
275-
? which(CLI.SF).stdout
276-
: path.join(this.options.directory, 'node_modules', '.bin', cli);
277-
this.logger.log(`Testing ${chalk.cyan(executable)}`);
272+
const executable = path.join(this.options.directory, 'node_modules', '.bin', this.options.cli);
273+
this.logger.log(`Testing ${chalk.cyan(executable)}`);
278274

279-
const result =
280-
process.platform === 'win32'
281-
? exec(`& "${executable}" --version`, { silent: true, shell: 'powershell.exe' })
282-
: exec(`${executable} --version`, { silent: true });
283-
this.logger.log(chalk.dim((result.stdout ?? result.stderr).replace(/\n*$/, '')));
284-
results[cli] = result.code === 0;
285-
}
275+
const result =
276+
process.platform === 'win32'
277+
? exec(`& "${executable}" --version`, { silent: true, shell: 'powershell.exe' })
278+
: exec(`${executable} --version`, { silent: true });
279+
this.logger.log(chalk.dim((result.stdout ?? result.stderr).replace(/\n*$/, '')));
280+
results[this.options.cli] = result.code === 0;
286281
return results;
287282
}
288283
}

0 commit comments

Comments
 (0)