Skip to content

[rush-lib] Use command instead of which #1826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2020
Merged

Conversation

jkroepke
Copy link
Contributor

Hi,

in some certain minimalistic build environments, @microsoft/rush can't installed because the command line tool which is not available.

 Installing @microsoft/rush...
 Error: Unable to install package: Error: Unable to determine the path to the NPM tool: Error: Command failed: which npm
 /bin/sh: which: command not found

While we could fix this issue by our own by just installing which I would like to improve this cool project a little bit.

In shell scripting it's preferred to use command -v instead which because the first one is a POSIX shell built-in. It looks like childProcess.execSync already opens a shell internally, we could use just the built-in helpers instead an external small utility.

Related resources:

@jkroepke jkroepke changed the title Use command instead which [rush] Use command instead which Apr 11, 2020
@jkroepke jkroepke changed the title [rush] Use command instead which [rush-lib] Use command instead which Apr 11, 2020
@msftclas
Copy link

msftclas commented Apr 11, 2020

CLA assistant check
All CLA requirements met.

@iclanton iclanton changed the title [rush-lib] Use command instead which [rush-lib] Use command instead of which Apr 13, 2020
Co-Authored-By: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
@iclanton iclanton merged commit 98fee0d into microsoft:master Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants