From: Austin Moore Date: Tue, 17 Mar 2015 07:01:33 +0000 (-0600) Subject: Add check for root in script/bootstrap.py X-Git-Tag: v0.22.0~1^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=2d1f70c1cf0c3e469717c404defb7f8732a6ae0a;p=electron.git Add check for root in script/bootstrap.py --- diff --git a/script/bootstrap.py b/script/bootstrap.py index 924b893c..190c6414 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -16,6 +16,7 @@ NPM = 'npm.cmd' if sys.platform in ['win32', 'cygwin'] else 'npm' def main(): + check_root() os.chdir(SOURCE_ROOT) args = parse_args() @@ -48,6 +49,13 @@ def parse_args(): help='Prints the output of the subprocesses') return parser.parse_args() +def check_root(): + if os.geteuid() == 0: + print "We suggest not running this as root, unless you're really sure." + choice = raw_input("Do you want to continue? [y/N]: ") + if choice not in ('y', 'Y'): + sys.exit(0) + def update_submodules(): execute_stdout(['git', 'submodule', 'sync'])