Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/prompt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as p from '@clack/prompts';
import { execaCommand } from 'execa';
import { execa } from 'execa';
import { cyan, dim } from 'kolorist';
import {
getExplanation,
Expand Down Expand Up @@ -40,9 +40,16 @@ async function runScript(script: string) {
p.outro(`${i18n.t('Running')}: ${script}`);
console.log('');
try {
await execaCommand(script, {
const shell =
process.platform === 'win32'
? process.env.ComSpec || process.env.COMSPEC || 'cmd.exe'
: process.env.SHELL || '/bin/sh';
const shellArgs =
process.platform === 'win32' ? ['/d', '/s', '/c', script] : ['-c', script];

// Use an explicit shell process so Node does not emit DEP0190 for shell=true.
await execa(shell, shellArgs, {
stdio: 'inherit',
shell: process.env.SHELL || true,
});
appendToShellHistory(script);
} catch (error) {
Expand Down