]> khamidou — GitHub mirrors - electron.git/commitdiff
Add check for root in script/bootstrap.py
authorAustin Moore <austin_moore@me.com>
Tue, 17 Mar 2015 07:01:33 +0000 (01:01 -0600)
committerAustin Moore <austin_moore@me.com>
Tue, 17 Mar 2015 07:01:33 +0000 (01:01 -0600)
script/bootstrap.py

index 924b893c0029c6c6568b1b5f64f444b280c74ae4..190c6414b7c0f18a2a9a527b710d13c2ad434a24 100755 (executable)
@@ -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'])