Browse Source

Added sudo requirement in requirements.js

pull/7/head
Muthu Kumar 7 years ago
parent
commit
34de278955
  1. 5
      package-lock.json
  2. 1
      package.json
  3. 7
      utils/requirements.js

5
package-lock.json

@ -983,6 +983,11 @@
"util-deprecate": "1.0.2"
}
},
"readline-sync": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.7.tgz",
"integrity": "sha1-ABv91MBhEMPAhMY798alYCIhPzA="
},
"rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",

1
package.json

@ -33,6 +33,7 @@
"fs-extra": "^4.0.2",
"prettyjson": "^1.2.1",
"prompt": "^1.0.0",
"readline-sync": "^1.4.7",
"shelljs": "^0.7.8"
},
"devDependencies": {

7
utils/requirements.js

@ -22,6 +22,12 @@ function requirements() {
" if you want `up` to be ported for your distro");
shell.exit(1);
}
// Check if sudo
if (process.getuid() != 0) {
console.log("`up` requires root privileges to work. Please use `sudo up <command>`");
shell.exit(1);
}
// Throw if Nginx is not found
if (!shell.which('nginx')) {
@ -29,7 +35,6 @@ function requirements() {
'I need nginx to work. Install nginx first. https://nginx.org/');
shell.exit(1);
}
}
module.exports = requirements;

Loading…
Cancel
Save