]> khamidou — GitHub mirrors - electron.git/commitdiff
Add argument that allows for non-interactive use
authorAustin Moore <austin_moore@me.com>
Tue, 17 Mar 2015 07:19:49 +0000 (01:19 -0600)
committerAustin Moore <austin_moore@me.com>
Tue, 17 Mar 2015 07:42:23 +0000 (01:42 -0600)
The newly added 'check_root()' method introduced an interactive prompt
that would ask the user if they wanted to continue. The new argument '-y'
will now skip the prompt, so that if a user needs to run this script
un-interactively, they can do so easily.

script/bootstrap.py

index 190c6414b7c0f18a2a9a527b710d13c2ad434a24..2954cea326aa575c32c3883bf77dab9ce65a239f 100755 (executable)
@@ -16,10 +16,12 @@ NPM = 'npm.cmd' if sys.platform in ['win32', 'cygwin'] else 'npm'
 
 
 def main():
-  check_root()
   os.chdir(SOURCE_ROOT)
 
   args = parse_args()
+  if (args.yes is False and
+      sys.platform not in ('win32', 'cygwin')):
+    check_root()
   if args.verbose:
     enable_verbose_mode()
   if sys.platform == 'cygwin':
@@ -47,6 +49,10 @@ def parse_args():
   parser.add_argument('-v', '--verbose',
                       action='store_true',
                       help='Prints the output of the subprocesses')
+  parser.add_argument('-y', '--yes', '--assume-yes',
+                      action='store_true',
+                      help='Run non-interactively by assuming "yes" to all ' \
+                           'prompts.')
   return parser.parse_args()
 
 def check_root():