diff options
author | Daniel Baumann <daniel@debian.org> | 2024-11-26 09:28:28 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-11-26 12:25:58 +0100 |
commit | a1882b67c41fe9901a0cd8059b5cc78a5beadec0 (patch) | |
tree | 2a24507c67aa99a15416707b2f7e645142230ed8 /extra/build-healthcheck.js | |
parent | Initial commit. (diff) | |
download | uptime-kuma-a1882b67c41fe9901a0cd8059b5cc78a5beadec0.tar.xz uptime-kuma-a1882b67c41fe9901a0cd8059b5cc78a5beadec0.zip |
Adding upstream version 2.0.0~beta.0+dfsg.upstream/2.0.0_beta.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'extra/build-healthcheck.js')
-rw-r--r-- | extra/build-healthcheck.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/extra/build-healthcheck.js b/extra/build-healthcheck.js new file mode 100644 index 0000000..e4c8026 --- /dev/null +++ b/extra/build-healthcheck.js @@ -0,0 +1,27 @@ +const childProcess = require("child_process"); +const fs = require("fs"); +const platform = process.argv[2]; + +if (!platform) { + console.error("No platform??"); + process.exit(1); +} + +if (platform === "linux/arm/v7") { + console.log("Arch: armv7"); + if (fs.existsSync("./extra/healthcheck-armv7")) { + fs.renameSync("./extra/healthcheck-armv7", "./extra/healthcheck"); + console.log("Already built in the host, skip."); + process.exit(0); + } else { + console.log("prebuilt not found, it will be slow! You should execute `npm run build-healthcheck-armv7` before build."); + } +} else { + if (fs.existsSync("./extra/healthcheck-armv7")) { + fs.rmSync("./extra/healthcheck-armv7"); + } +} + +const output = childProcess.execSync("go build -x -o ./extra/healthcheck ./extra/healthcheck.go").toString("utf8"); +console.log(output); + |