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

Persist node version choice on Mac/Linux #86

Merged
merged 4 commits into from May 25, 2020

Conversation

elsassph
Copy link
Contributor

@elsassph elsassph commented Dec 12, 2019

Fixes #24

Implementation:

  • when adding -Persist, the version is written to a default file (similar to .nvmrc) in the vs folder where the node binaries are downloaded,
  • depending on the scope (User, Machine) a call to Set-NodeVersion (without arguments) is appended to the appropriate profile.ps1.
  • Set-NodeVersion when called without version parameter will fallback to the version written in the default file.

Notes:

  • This is similar to the way nvm-sh functions (storing the version in a default file and setting the path when the user profile scripts is executed),
  • It may be worth documenting how to set the Machine configuration as it requires escalation:
sudo pwsh -c 'Set-NodeVersion 10 -Persist Machine'

@elsassph
Copy link
Contributor Author

elsassph commented Dec 13, 2019

Not sure why tests don't pass... I'll need to try with Windows maybe.

@aaronpowell
Copy link
Owner

aaronpowell commented Dec 15, 2019

sigh

Looks like something has changed in Travis since last set of build runs. Maybe we should move to GitHub actions 😜

@aaronpowell
Copy link
Owner

aaronpowell commented Dec 15, 2019

@felixfbecker are you able to run the tests locally on a mac? I can try Windows next week.

@elsassph
Copy link
Contributor Author

elsassph commented Jan 5, 2020

Any progress?

Philippe Elsass and others added 2 commits Jan 24, 2020
Fixed default node detection to ignore package.json without version if a default one can be found
@aaronpowell aaronpowell merged commit 9e510b6 into aaronpowell:master May 25, 2020
1 of 4 checks passed
@aaronpowell
Copy link
Owner

aaronpowell commented May 25, 2020

And released as 2.5.1 (I stuffed up the GitHub Actions for 2.5.0 so it didn't deploy 🤣)

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.

Persistent default on macOS
2 participants