aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-19 10:44:16 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-03-19 10:44:16 -0700
commit10cfa9fc93ab611fb8c94aed563513fe9c124644 (patch)
treebb63251c66f6736bf77d05a890878e9460199d1c
parent5179ae5746bbb624f768b54ebe034d751005483e (diff)
emcc 'just copy' should do nothing if there is no target
-rwxr-xr-xemcc7
1 files changed, 5 insertions, 2 deletions
diff --git a/emcc b/emcc
index 7987e2e6..87b20e07 100755
--- a/emcc
+++ b/emcc
@@ -355,8 +355,11 @@ for i in range(len(sys.argv)-1):
break
if header: # header or such
- if DEBUG: print >> sys.stderr, 'Just copy.'
- shutil.copy(sys.argv[-1], sys.argv[-2])
+ if len(sys.argv) >= 3: # if there is a source and a target, then copy, otherwise do nothing
+ if DEBUG: print >> sys.stderr, 'Just copy.'
+ shutil.copy(sys.argv[-1], sys.argv[-2])
+ else:
+ if DEBUG: print >> sys.stderr, 'No-op.'
exit(0)
if TEMP_DIR: