]> khamidou — GitHub mirrors - electron.git/commitdiff
introduce execute_stdout
authorIgorKlopov <igor@klopov.com>
Sun, 7 Dec 2014 23:42:55 +0000 (02:42 +0300)
committerIgorKlopov <igor@klopov.com>
Sun, 7 Dec 2014 23:42:55 +0000 (02:42 +0300)
`execute_stdout` does not return the output of the process. Instead it outputs directly to current stdout (in real-time - to see what is `npm` doing now)

script/lib/util.py

index 9734005ddb14589bde8b516fd8f7aafad5d0fc9e..852d2af194cc6c390259c545b5f2e20d0b7ff0e8 100644 (file)
@@ -144,6 +144,18 @@ def execute(argv):
     raise e
 
 
+def execute_stdout(argv):
+  if verbose_mode:
+    print ' '.join(argv)
+    try:
+      subprocess.check_call(argv)
+    except subprocess.CalledProcessError as e:
+      print e.output
+      raise e
+  else:
+    return execute(argv)
+
+
 def get_atom_shell_version():
   return subprocess.check_output(['git', 'describe', '--tags']).strip()