Skip to content

Commit

Permalink
use run instead of exec in npm/pnpm proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jun 21, 2023
1 parent 83e84dd commit 9f12f5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions code/lib/cli/src/initiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise<vo
const storybookCommand =
projectType === ProjectType.ANGULAR
? `ng run ${installResult.projectName}:storybook`
: packageManager.getRunStorybookCommand();
: 'storybook';
logger.log(
boxen(
dedent`
Expand All @@ -352,7 +352,7 @@ async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise<vo
// executed directly in the user's project directory. This avoid potential issues
// with packages running in npxs' node_modules
packageManager.runPackageCommandSync(
storybookCommand.replace(/^(yarn|pnpm|npm) /, ''),
storybookCommand,
['--quiet'],
undefined,
'inherit'
Expand Down
4 changes: 2 additions & 2 deletions code/lib/cli/src/js-package-manager/NPMProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class NPMProxy extends JsPackageManager {
): string {
return this.executeCommandSync({
command: 'npm',
args: ['exec', '--', command, ...args],
args: ['run', command, '--', ...args],
cwd,
stdio,
});
Expand All @@ -130,7 +130,7 @@ export class NPMProxy extends JsPackageManager {
public async runPackageCommand(command: string, args: string[], cwd?: string): Promise<string> {
return this.executeCommand({
command: 'npm',
args: ['exec', '--', command, ...args],
args: ['run', command, '--', ...args],
cwd,
});
}
Expand Down
4 changes: 2 additions & 2 deletions code/lib/cli/src/js-package-manager/PNPMProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class PNPMProxy extends JsPackageManager {
): string {
return this.executeCommandSync({
command: 'pnpm',
args: ['exec', command, ...args],
args: ['run', command, ...args],
cwd,
stdio,
});
Expand All @@ -92,7 +92,7 @@ export class PNPMProxy extends JsPackageManager {
async runPackageCommand(command: string, args: string[], cwd?: string): Promise<string> {
return this.executeCommand({
command: 'pnpm',
args: ['exec', command, ...args],
args: ['run', command, ...args],
cwd,
});
}
Expand Down

0 comments on commit 9f12f5c

Please sign in to comment.