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'
green = '\x1b[32m\x1b[1m'
reset = '\x1b(B\x1b[m'
@ -15,12 +20,15 @@ with open('.travis.yml') as f:
script_found = True
elif script_found:
if line.startswith('- '):
commands.append(line[2:].rstrip('\r\n'))
if line.startswith('- python '):
commands.append(line[2:].rstrip('\r\n'))
else:
break
ret = 0
for cmd in commands:
print('$ %s' % cmd)
if args.dry_run:
continue
start = time.time()
code = os.system(cmd)
end = time.time()