Merge branch 'master' into chrome39
Conflicts: vendor/brightray
This commit is contained in:
commit
da3a988c8c
11 changed files with 80 additions and 66 deletions
|
@ -23,3 +23,13 @@ TARGET_PLATFORM = {
|
|||
'linux2': 'linux',
|
||||
'win32': 'win32',
|
||||
}[sys.platform]
|
||||
|
||||
verbose_mode = False
|
||||
|
||||
def enable_verbose_mode():
|
||||
print 'Running in verbose mode'
|
||||
global verbose_mode
|
||||
verbose_mode = True
|
||||
|
||||
def is_verbose_mode():
|
||||
return verbose_mode
|
||||
|
|
|
@ -12,7 +12,7 @@ import urllib2
|
|||
import os
|
||||
import zipfile
|
||||
|
||||
verbose_mode = False
|
||||
from config import is_verbose_mode
|
||||
|
||||
def tempdir(prefix=''):
|
||||
directory = tempfile.mkdtemp(prefix=prefix)
|
||||
|
@ -20,12 +20,6 @@ def tempdir(prefix=''):
|
|||
return directory
|
||||
|
||||
|
||||
def enable_verbose_execute():
|
||||
print 'Running in verbose mode'
|
||||
global verbose_mode
|
||||
verbose_mode = True
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def scoped_cwd(path):
|
||||
cwd = os.getcwd()
|
||||
|
@ -132,9 +126,11 @@ def safe_mkdir(path):
|
|||
|
||||
|
||||
def execute(argv):
|
||||
if is_verbose_mode():
|
||||
print ' '.join(argv)
|
||||
try:
|
||||
output = subprocess.check_output(argv, stderr=subprocess.STDOUT)
|
||||
if verbose_mode:
|
||||
if is_verbose_mode():
|
||||
print output
|
||||
return output
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
@ -142,6 +138,18 @@ def execute(argv):
|
|||
raise e
|
||||
|
||||
|
||||
def execute_stdout(argv):
|
||||
if is_verbose_mode():
|
||||
print ' '.join(argv)
|
||||
try:
|
||||
subprocess.check_call(argv)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print e.output
|
||||
raise e
|
||||
else:
|
||||
execute(argv)
|
||||
|
||||
|
||||
def get_atom_shell_version():
|
||||
return subprocess.check_output(['git', 'describe', '--tags']).strip()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue