diff --git a/package-lock.json b/package-lock.json index 9c9fcff..2cd5ba3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "domcloud-bridge", - "version": "0.66.0", + "version": "0.67.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "domcloud-bridge", - "version": "0.66.0", + "version": "0.67.0", "license": "MIT", "dependencies": { "cli": "^1.0.1", diff --git a/package.json b/package.json index 0d181d4..6ffe1dc 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/executor/runnercode.js b/src/executor/runnercode.js index 245543f..edaf045 100644 --- a/src/executor/runnercode.js +++ b/src/executor/runnercode.js @@ -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);