fix(ng-dev/release): silence nvm which command output during release verification#3662
Conversation
|
This PR was merged into the repository. The changes were merged into the following branches:
|
There was a problem hiding this comment.
Code Review
This pull request updates the nvm command in external-commands.ts to include the --silent flag. Feedback indicates that the command uses bash-specific features incompatible with Windows and that the --silent flag requires nvm v0.39.0 or newer, which may cause issues for users on older versions.
| // We redirect stdout of nvm install to stderr so that stdout only contains the result of nvm which. | ||
| const {stdout} = await ChildProcess.spawn( | ||
| '. ~/.nvm/nvm.sh && nvm install >&2 && nvm which', | ||
| '. ~/.nvm/nvm.sh && nvm install >&2 && nvm which --silent', |
There was a problem hiding this comment.
The command string uses several bash-specific features (e.g., the . built-in, the ~ home directory shortcut, and sourcing a .sh file) which are not compatible with Windows. This violates the general rule that ng-dev tooling should be compatible with Windows.
Additionally, please note that the --silent flag for nvm which was introduced in nvm v0.39.0. If users are running an older version of nvm, this command will treat --silent as a version argument, fail to find it, and print an error to stdout, which would break the nodeBinPath detection.
References
- ng-dev tooling is expected to be compatible with Windows.
Suppresses unwanted output to stdout during nvm node path resolution by passing the --silent flag to nvm which.