From cde5789614fed5f6ad264aad63bd5b1336bc419c Mon Sep 17 00:00:00 2001 From: Jakob Stendahl <14180120+JakobST1n@users.noreply.github.com> Date: Sat, 13 Nov 2021 20:39:05 +0100 Subject: Update index.js --- src/SelfUpdater/index.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/SelfUpdater') diff --git a/src/SelfUpdater/index.js b/src/SelfUpdater/index.js index cc4e298..68f6a1d 100644 --- a/src/SelfUpdater/index.js +++ b/src/SelfUpdater/index.js @@ -209,10 +209,19 @@ class Updater { async installDependencies() { // So, the server is running as root, that means we can just do this. // we shouldn't, but, anyway. - await this.run("sh", ["-c", "wget -qO- https://deb.nodesource.com/setup_14.x | bash -"]); - await this.run("apt", ["-qy", "install", "nodejs", "python3-pip"]); - await this.run("pip3", ["install", "virtualenv"]); - await this.run("sh", ["-c", `export NODE_ENV=development; npm --prefix \"${__appdir}\" install \"${__appdir}\"`]); + let arch = (await this.run(`uname`, ["-m"])).out.replace("\n",""); + if (arch == "armv6l") { + await this.run("wget", ["https://unofficial-builds.nodejs.org/download/release/v14.10.0/node-v14.10.0-linux-armv6l.tar.gz"]); + await this.run("tar", ["-xzf" "node-v14.10.0-linux-armv6l.tar.gz"]); + await this.run("cp", ["-r", "node-v14.10.0-linux-armv6l/*", "/usr/local"]); + await this.run("rm", ["-r", "node-v14.10.0-linux-armv6l"]); + await this.run("rm", ["node-v14.10.0-linux-armv6l.tar.gz"]); + } else { + await this.run("sh", ["-c", "wget -qO- https://deb.nodesource.com/setup_14.x | bash -"]); + await this.run("apt", ["-qy", "install", "nodejs", "python3-pip"]); + await this.run("pip3", ["install", "virtualenv"]); + await this.run("sh", ["-c", `export NODE_ENV=development; npm --prefix \"${__appdir}\" install \"${__appdir}\"`]); + } } async makeVirtualenv() { @@ -305,4 +314,4 @@ class SelfUpdater { module.exports = (_neoModules) => { neoModules = _neoModules; return new SelfUpdater(); -}; \ No newline at end of file +}; -- cgit v1.2.3