From 36479dbcda636ba983cc05ae4d2cef1c7fb2812f Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 13 Oct 2015 21:31:37 -0400 Subject: [PATCH] travis/all.py: Avoid actually building DFHack --- travis/all.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/travis/all.py b/travis/all.py index b9dacc208..281911e7a 100644 --- a/travis/all.py +++ b/travis/all.py @@ -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()