aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-15 11:01:56 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-15 11:01:56 -0800
commit8b1ee6dde83f6b4a10978b36a18c628dfa0a0ca8 (patch)
tree8fa4f2f3509920b066b2a4d3396080cc381587b8 /emcc
parent538be53ff63b2302c9317e9b6515ee89677f10f2 (diff)
allow specifying the temp dir for emcc
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc12
1 files changed, 9 insertions, 3 deletions
diff --git a/emcc b/emcc
index 62225e1c..3e00d9ec 100755
--- a/emcc
+++ b/emcc
@@ -78,7 +78,7 @@ from subprocess import Popen, PIPE, STDOUT
from tools import shared
DEBUG = os.environ.get('EMCC_DEBUG')
-SAVE_FILES = os.environ.get('EMCC_SAVE_FILES') # saves some of the intermediate files
+TEMP_DIR = os.environ.get('EMCC_TEMP_DIR')
################### XXX
print >> sys.stderr, '\n***This is a WORK IN PROGRESS***'
@@ -217,7 +217,13 @@ if header: # header or such
shutil.copy(sys.argv[-1], sys.argv[-2])
exit(0)
-temp_dir = tempfile.mkdtemp()
+if TEMP_DIR:
+ temp_dir = TEMP_DIR
+ if not os.path.exists(temp_dir):
+ os.makedirs(temp_dir)
+else:
+ temp_dir = tempfile.mkdtemp()
+
def in_temp(name):
return os.path.join(temp_dir, name)
@@ -401,7 +407,7 @@ try:
shutil.move(final, target_basename + '.js')
finally:
- if not SAVE_FILES:
+ if not TEMP_DIR:
try:
shutil.rmtree(temp_dir)
except: