Skip to content

Commit 7a3e62f

Browse files
committed
update
1 parent a046d56 commit 7a3e62f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/package-manager-completion.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ function runCompletionCommand(
2828
leadingArgs: string[],
2929
completionArgs: string[]
3030
): string {
31-
const targetCommand = preferCmdShim(command);
3231
const args = [...leadingArgs, 'complete', '--', ...completionArgs];
3332

34-
// PowerShell: prefer invoking via powershell.exe so .ps1 shims are resolved.
35-
if (isPowerShellEnv && path.extname(targetCommand) === '') {
36-
return runCompletionViaPowerShell(targetCommand, args);
33+
// In a PowerShell host, go through powershell.exe so .ps1 shims work.
34+
if (isPowerShellEnv) {
35+
return runCompletionViaPowerShell(command, args);
3736
}
3837

38+
const targetCommand = preferCmdShim(command);
3939
const result = spawnSync(targetCommand, args, completionSpawnOptions);
4040

4141
return (result.stdout ?? '').trim();

0 commit comments

Comments
 (0)