Skip to content

Commit

Permalink
Use nvm
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Oct 31, 2024
1 parent c69f7bc commit 441d210
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domcloud-bridge",
"version": "0.66.0",
"version": "0.67.0",
"description": "Deployment runner for DOM Cloud",
"main": "app.js",
"engines": {
Expand Down
9 changes: 4 additions & 5 deletions src/executor/runnercode.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,18 @@ export async function runConfigCodeFeatures(key, value, writeLog, domaindata, ss
if (arg == 'off') {
await writeLog("$> Removing Node engine");
await sshExec("rm -rf ~/.local/opt/node-* ~/.local/opt/node ~/Downloads/webi/node");
await sshExec("rm -rf ~/.cache/yarn ~/.cache/node ~/.config/yarn ~/.npm");
await sshExec("rm -rf ~/.cache/yarn ~/.cache/node ~/.config/yarn ~/.npm ~/.nvm");
await sshExec("pathman remove .local/opt/node/bin");
} else {
if (value == "latest" || value == "current") {
arg = "";
} else if (!value || value == "stable") {
arg = "@lts";
arg = "lts";
} else {
arg = "@" + value;
arg = value;
}
await writeLog("$> Changing Node engine to " + (value || 'lts'));
await sshExec("pathman add .local/opt/node/bin ; source ~/.config/envman/PATH.env");
await sshExec(`curl -sS https://webinstall.dev/node${arg} | bash`);
await sshExec("command -v nvm &> /dev/null || (curl -o- https://github.com/nvm-sh/nvm/raw/refs/heads/master/install.sh | bash) && source ~/.bashrc");
await sshExec("command -v corepack &> /dev/null || npm i -g corepack && corepack enable");
await sshExec(`[[ -z $COREPACK_ENABLE_AUTO_PIN ]] && echo "export COREPACK_ENABLE_AUTO_PIN=0" >> ~/.bashrc`)
await sshExec("source ~/.bashrc", false);
Expand Down

0 comments on commit 441d210

Please sign in to comment.