зеркало из https://github.com/electron/electron.git
Do not print download progress in CI.
This commit is contained in:
Родитель
fde4c544b8
Коммит
a76183c188
|
@ -11,6 +11,8 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|||
|
||||
|
||||
def main():
|
||||
os.environ['CI'] = '1'
|
||||
|
||||
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
|
||||
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
|
||||
rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))
|
||||
|
|
|
@ -36,6 +36,8 @@ def download(text, url, path):
|
|||
downloaded_size = 0
|
||||
block_size = 128
|
||||
|
||||
ci = os.environ.get('CI') == '1'
|
||||
|
||||
while True:
|
||||
buf = web_file.read(block_size)
|
||||
if not buf:
|
||||
|
@ -44,10 +46,14 @@ def download(text, url, path):
|
|||
downloaded_size += len(buf)
|
||||
local_file.write(buf)
|
||||
|
||||
if not ci:
|
||||
percent = downloaded_size * 100. / file_size
|
||||
status = "\r%s %10d [%3.1f%%]" % (text, downloaded_size, percent)
|
||||
print status,
|
||||
|
||||
if ci:
|
||||
print "%s done." % (text)
|
||||
else:
|
||||
print
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче