mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
WIP
This commit is contained in:
parent
062e9db2a7
commit
d76a515cbf
3 changed files with 24 additions and 0 deletions
18
extra/cli.js
Normal file
18
extra/cli.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
if (!process.env.DATA_DIR) {
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
process.env.DATA_DIR = process.env.LOCALAPPDATA + "\\uptime-kuma\\";
|
||||||
|
} else if (process.platform === "linux") {
|
||||||
|
process.env.DATA_DIR = process.env.HOME + "/.local/share/uptime-kuma/";
|
||||||
|
} else if (process.platform === "darwin") {
|
||||||
|
// TODO: Not sure if this is the correct path for macOS
|
||||||
|
process.env.DATA_DIR = process.env.HOME + "/Library/Preferences/uptime-kuma/";
|
||||||
|
} else {
|
||||||
|
console.error("Unable to detect app data directory on platform: " + process.platform);
|
||||||
|
console.error("Please set the DATA_DIR environment variable or `--data-dir=` to the directory where you want to store your data.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
require("../server/server");
|
3
package-lock.json
generated
3
package-lock.json
generated
|
@ -75,6 +75,9 @@
|
||||||
"thirty-two": "~1.0.2",
|
"thirty-two": "~1.0.2",
|
||||||
"ws": "^8.13.0"
|
"ws": "^8.13.0"
|
||||||
},
|
},
|
||||||
|
"bin": {
|
||||||
|
"uptime-kuma": "extra/cli.js"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/github": "~5.0.1",
|
"@actions/github": "~5.0.1",
|
||||||
"@babel/eslint-parser": "^7.22.7",
|
"@babel/eslint-parser": "^7.22.7",
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "14 || 16 || 18 || >= 20.4.0"
|
"node": "14 || 16 || 18 || >= 20.4.0"
|
||||||
},
|
},
|
||||||
|
"bin": {
|
||||||
|
"uptime-kuma": "./extra/cli.js"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install-legacy": "npm install",
|
"install-legacy": "npm install",
|
||||||
"update-legacy": "npm update",
|
"update-legacy": "npm update",
|
||||||
|
|
Loading…
Reference in a new issue