Skip to content

Commit 76fcd52

Browse files
committed
fix: cli detect pwsh
1 parent 1d3046e commit 76fcd52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const shells = ['zsh', 'bash', 'fish', 'powershell'];
99

1010
async function main() {
1111
const args = process.argv.slice(2);
12+
const isPwsh = process.platform === 'win32' && !!process.env.PSModulePath;
13+
if ( isPwsh && args.length >= 2 && args[1] === 'complete' && process.argv.indexOf('--') === -1 ) {
14+
process.argv.push('--');
15+
}
1216

1317
// <packageManager> complete -- <args>
1418
if (args.length >= 2 && args[1] === 'complete') {
@@ -57,7 +61,7 @@ async function main() {
5761
process.exit(0);
5862
}
5963

60-
console.error('Usage: tab <packageManager> <shell>');
64+
console.error('Usages: tab <packageManager> <shell>');
6165
console.error(` tab <packageManager> complete -- <args>`);
6266
process.exit(1);
6367
}

0 commit comments

Comments
 (0)