mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-19 10:46:48 +02:00
Rollback "command-exists-promise" as it is not working
This commit is contained in:
parent
86de907acd
commit
1f4622f5f3
5 changed files with 20 additions and 13 deletions
11
package-lock.json
generated
11
package-lock.json
generated
|
@ -21,7 +21,7 @@
|
||||||
"check-password-strength": "^2.0.5",
|
"check-password-strength": "^2.0.5",
|
||||||
"cheerio": "~1.0.0-rc.12",
|
"cheerio": "~1.0.0-rc.12",
|
||||||
"chroma-js": "~2.4.2",
|
"chroma-js": "~2.4.2",
|
||||||
"command-exists-promise": "~2.0.2",
|
"command-exists": "~1.2.9",
|
||||||
"compare-versions": "~3.6.0",
|
"compare-versions": "~3.6.0",
|
||||||
"compression": "~1.7.4",
|
"compression": "~1.7.4",
|
||||||
"country-flag-emoji-polyfill": "^0.1.8",
|
"country-flag-emoji-polyfill": "^0.1.8",
|
||||||
|
@ -6892,15 +6892,6 @@
|
||||||
"integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==",
|
"integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/command-exists-promise": {
|
|
||||||
"version": "2.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/command-exists-promise/-/command-exists-promise-2.0.2.tgz",
|
|
||||||
"integrity": "sha512-T6PB6vdFrwnHXg/I0kivM3DqaCGZLjjYSOe0a5WgFKcz1sOnmOeIjnhQPXVXX3QjVbLyTJ85lJkX6lUpukTzaA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/commander": {
|
"node_modules/commander": {
|
||||||
"version": "10.0.1",
|
"version": "10.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
"check-password-strength": "^2.0.5",
|
"check-password-strength": "^2.0.5",
|
||||||
"cheerio": "~1.0.0-rc.12",
|
"cheerio": "~1.0.0-rc.12",
|
||||||
"chroma-js": "~2.4.2",
|
"chroma-js": "~2.4.2",
|
||||||
"command-exists-promise": "~2.0.2",
|
"command-exists": "~1.2.9",
|
||||||
"compare-versions": "~3.6.0",
|
"compare-versions": "~3.6.0",
|
||||||
"compression": "~1.7.4",
|
"compression": "~1.7.4",
|
||||||
"country-flag-emoji-polyfill": "^0.1.8",
|
"country-flag-emoji-polyfill": "^0.1.8",
|
||||||
|
|
|
@ -2,13 +2,13 @@ const { MonitorType } = require("./monitor-type");
|
||||||
const { chromium } = require("playwright-core");
|
const { chromium } = require("playwright-core");
|
||||||
const { UP, log } = require("../../src/util");
|
const { UP, log } = require("../../src/util");
|
||||||
const { Settings } = require("../settings");
|
const { Settings } = require("../settings");
|
||||||
const commandExists = require("command-exists-promise");
|
|
||||||
const childProcess = require("child_process");
|
const childProcess = require("child_process");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const Database = require("../database");
|
const Database = require("../database");
|
||||||
const jwt = require("jsonwebtoken");
|
const jwt = require("jsonwebtoken");
|
||||||
const config = require("../config");
|
const config = require("../config");
|
||||||
const { RemoteBrowser } = require("../remote-browser");
|
const { RemoteBrowser } = require("../remote-browser");
|
||||||
|
const { commandExists } = require("../util-server");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cached instance of a browser
|
* Cached instance of a browser
|
||||||
|
|
|
@ -77,6 +77,7 @@ const SendGrid = require("./notification-providers/send-grid");
|
||||||
const YZJ = require("./notification-providers/yzj");
|
const YZJ = require("./notification-providers/yzj");
|
||||||
const SMSPlanet = require("./notification-providers/sms-planet");
|
const SMSPlanet = require("./notification-providers/sms-planet");
|
||||||
const SpugPush = require("./notification-providers/spugpush");
|
const SpugPush = require("./notification-providers/spugpush");
|
||||||
|
const { commandExists } = require("./util-server");
|
||||||
|
|
||||||
class Notification {
|
class Notification {
|
||||||
|
|
||||||
|
@ -262,7 +263,6 @@ class Notification {
|
||||||
* @returns {Promise<boolean>} Does the command apprise exist?
|
* @returns {Promise<boolean>} Does the command apprise exist?
|
||||||
*/
|
*/
|
||||||
static async checkApprise() {
|
static async checkApprise() {
|
||||||
const commandExists = require("command-exists-promise");
|
|
||||||
return await commandExists("apprise");
|
return await commandExists("apprise");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1096,3 +1096,19 @@ module.exports.axiosAbortSignal = (timeoutMs) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, command-exists will throw a null error if the command does not exist, which is ugly. The function makes it better.
|
||||||
|
* Read more: https://github.com/mathisonian/command-exists/issues/22
|
||||||
|
* @param {string} command Command to check
|
||||||
|
* @returns {Promise<boolean>} True if command exists, false otherwise
|
||||||
|
*/
|
||||||
|
async function commandExists(command) {
|
||||||
|
try {
|
||||||
|
await require("command-exists")(command);
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports.commandExists = commandExists;
|
||||||
|
|
Loading…
Add table
Reference in a new issue