-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the logic to get the npm version from the npm CLI to use the synchronous version of `exec`, `execSync`, to ensure the output can be read correctly. In the previous implementation the output would not be read correctly, leading to the comparison at `handleInput.ts:14` always evaluating to false and `'--omit=dev'` always being used.
- Loading branch information
1 parent
adf6857
commit 8820f03
Showing
2 changed files
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import { exec } from 'child_process'; | ||
import { Readable } from 'stream'; | ||
import { execSync } from 'child_process'; | ||
|
||
/** | ||
* Get the current npm version | ||
* @return {String} The npm version | ||
*/ | ||
export function getNpmVersion(): string { | ||
const version = exec('npm --version'); | ||
return (version.stdout as Readable).toString(); | ||
const version = execSync('npm --version'); | ||
return version.toString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters