Skip to content

Persist node version choice on Mac/Linux#86

Merged
aaronpowell merged 4 commits intoaaronpowell:masterfrom
elsassph:fix/24-persist-nix
May 25, 2020
Merged

Persist node version choice on Mac/Linux#86
aaronpowell merged 4 commits intoaaronpowell:masterfrom
elsassph:fix/24-persist-nix

Conversation

@elsassph
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@aaronpowell
Copy link
Copy Markdown
Owner

sigh

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

@aaronpowell
Copy link
Copy Markdown
Owner

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

@elsassph
Copy link
Copy Markdown
Contributor Author

elsassph commented Jan 5, 2020

Any progress?

Philippe Elsass and others added 2 commits January 24, 2020 12:09
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
@aaronpowell
Copy link
Copy Markdown
Owner

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