travis/all.py: Avoid actually building DFHack

develop
lethosor 2015-10-13 21:31:37 -04:00
parent 7e8200603c
commit 36479dbcda
1 changed files with 10 additions and 2 deletions

@ -1,4 +1,9 @@
import os, sys, time import argparse, os, sys, time
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--dry-run', action='store_true', help='Display commands without running them')
args = parser.parse_args()
red = '\x1b[31m\x1b[1m' red = '\x1b[31m\x1b[1m'
green = '\x1b[32m\x1b[1m' green = '\x1b[32m\x1b[1m'
reset = '\x1b(B\x1b[m' reset = '\x1b(B\x1b[m'
@ -15,12 +20,15 @@ with open('.travis.yml') as f:
script_found = True script_found = True
elif script_found: elif script_found:
if line.startswith('- '): if line.startswith('- '):
commands.append(line[2:].rstrip('\r\n')) if line.startswith('- python '):
commands.append(line[2:].rstrip('\r\n'))
else: else:
break break
ret = 0 ret = 0
for cmd in commands: for cmd in commands:
print('$ %s' % cmd) print('$ %s' % cmd)
if args.dry_run:
continue
start = time.time() start = time.time()
code = os.system(cmd) code = os.system(cmd)
end = time.time() end = time.time()