Skip to content

Commit

Permalink
feat: replace execSync with spawnSync
Browse files Browse the repository at this point in the history
  • Loading branch information
DOlufemi committed Oct 7, 2024
1 parent 621450d commit 0d64ae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/composer-cmds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const composerShowCmd = 'composer show -p';
export const pharCmd = `php ${path.resolve(path.resolve() + '/composer.phar')} show -p --format=json`;

export function cmdReturnsOk(cmd): boolean {
return cmd && childProcess.spawnSync(cmd, { shell: true }).status === 0;
return cmd && childProcess.spawnSync(cmd, { shell: false }).status === 0;
}

// run a cmd in a specific folder and it's result should be there
export function execWithResult(cmd, basePath): string {
return childProcess.execSync(cmd, { cwd: basePath }).toString();
return childProcess.spawnSync(cmd, { cwd: basePath, shell: false }).toString();
}

0 comments on commit 0d64ae5

Please sign in to comment.