From 6e943b72de2c5d5d6a7090102bf69b27ab05500b Mon Sep 17 00:00:00 2001 From: ray-1337 <33544674+ray-1337@users.noreply.github.com> Date: Tue, 12 Apr 2022 11:33:33 +0200 Subject: [PATCH] fixed checkSudo util --- src/Util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Util.js b/src/Util.js index db6af70..23c4d0d 100644 --- a/src/Util.js +++ b/src/Util.js @@ -4,7 +4,9 @@ const promisifiedExec = promisify(exec); const process = require("process"); module.exports.checkSudo = function () { - if (!process.getuid()) { + if (process.getuid && process.getuid() == 0) { + return true; + } else { throw new Error("You need to be root to run this package."); }; };