]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix executing upload-node-headers.py in cygwin
authorCheng Zhao <zcbenz@gmail.com>
Fri, 23 Jan 2015 01:58:54 +0000 (17:58 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 27 Jan 2015 21:19:18 +0000 (13:19 -0800)
script/upload-node-headers.py

index 7b5ad135c9a2390470dcc3a0d967a3685dfb043f..6734929c10e7b1eeb51443eba6c450cb27f0870a 100755 (executable)
@@ -105,10 +105,9 @@ def copy_source_file(source, start, destination):
 
 
 def upload_node(bucket, access_key, secret_key, version):
-  os.chdir(DIST_DIR)
-
-  s3put(bucket, access_key, secret_key, DIST_DIR,
-        'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
+  with scoped_cwd(DIST_DIR):
+    s3put(bucket, access_key, secret_key, DIST_DIR,
+          'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
 
   if TARGET_PLATFORM == 'win32':
     # Generate the node.lib.
@@ -127,13 +126,14 @@ def upload_node(bucket, access_key, secret_key, version):
           'atom-shell/dist/{0}'.format(version), [node_lib])
 
     # Upload the index.json
-    atom_shell = os.path.join(OUT_DIR, 'atom.exe')
-    index_json = os.path.join(OUT_DIR, 'index.json')
-    execute([atom_shell,
-             os.path.join(SOURCE_ROOT, 'script', 'dump-version-info.js'),
-             index_json])
-    s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
-          [index_json])
+    with scoped_cwd(SOURCE_ROOT):
+      atom_shell = os.path.join(OUT_DIR, 'atom.exe')
+      index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
+      execute([atom_shell,
+               os.path.join('script', 'dump-version-info.js'),
+               index_json])
+      s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
+            [index_json])
 
 
 def touch_x64_node_lib():