Browse Source

fixed checkSudo util

develop
ray-1337 3 years ago
parent
commit
6e943b72de
  1. 4
      src/Util.js

4
src/Util.js

@ -4,7 +4,9 @@ const promisifiedExec = promisify(exec);
const process = require("process"); const process = require("process");
module.exports.checkSudo = function () { 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."); throw new Error("You need to be root to run this package.");
}; };
}; };

Loading…
Cancel
Save