Skip to content
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

fix: detect path key based on correct environment #133

Merged
merged 1 commit into from
May 24, 2020
Merged

fix: detect path key based on correct environment #133

merged 1 commit into from
May 24, 2020

Conversation

bgotink
Copy link
Contributor

@bgotink bgotink commented May 24, 2020

Scenario:

Windows machine with Path environment key containing the PATH. An environment is passed in where the PATH is named PATH.
cross-spawn will pass an undefined path into which, which makes which fall back to process.env.Path.

This is troublesome if the first hit in options.env.PATH is not an executable file but the first hit in process.env.Path is an executable file. cross-spawn doesn't realise it needs to wrap the command with cmd.exe.

We're running into this in yarnpkg/berry#1377, where we prepend the PATH with a folder containing node.cmd but cross-spawn detects C:\Program Files\nodejs\node.exe instead.

@codecov
Copy link

codecov bot commented May 24, 2020

Codecov Report

Merging #133 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #133   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          162       163    +1     
  Branches        34        35    +1     
=========================================
+ Hits           162       163    +1     
Impacted Files Coverage Δ
lib/util/resolveCommand.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7501971...9a4cca3. Read the comment docs.

@satazor satazor merged commit 159e7e9 into moxystudio:master May 24, 2020
@satazor
Copy link
Contributor

satazor commented May 24, 2020

Thanks for your contribution, will release soon.

@satazor
Copy link
Contributor

satazor commented May 25, 2020

Released: 7bc42bc

@bgotink
Copy link
Contributor Author

bgotink commented May 25, 2020

Wow that was fast! Thanks!

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.

2 participants