]> khamidou — GitHub mirrors - electron.git/commitdiff
The distribution name should contain version and platform.
authorCheng Zhao <zcbenz@gmail.com>
Sat, 31 Aug 2013 02:35:01 +0000 (10:35 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 31 Aug 2013 02:35:01 +0000 (10:35 +0800)
script/create-dist.py
script/upload.py

index 40d3854ff25a236680c36e5983cacea3c7919f58..acb092b5077ede3e0897ec49cd8e35e930f0149e 100755 (executable)
@@ -11,10 +11,12 @@ import tarfile
 from lib.util import *
 
 
+ATOM_SHELL_VRESION = get_atom_shell_version()
+
 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
 NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node')
-DIST_HEADERS_NAME = 'node-{0}'.format(get_atom_shell_version())
+DIST_HEADERS_NAME = 'node-{0}'.format(ATOM_SHELL_VRESION)
 DIST_HEADERS_DIR = os.path.join(DIST_DIR, DIST_HEADERS_NAME)
 
 TARGET_PLATFORM = {
@@ -125,12 +127,13 @@ def copy_license():
 def create_version():
   version_path = os.path.join(SOURCE_ROOT, 'dist', 'version')
   with open(version_path, 'w') as version_file:
-    version_file.write(get_atom_shell_version())
+    version_file.write(ATOM_SHELL_VRESION)
 
 
 def create_zip():
-  zip_file = os.path.join(SOURCE_ROOT, 'dist', 'atom-shell.zip')
-  safe_unlink(zip_file)
+  dist_name = 'atom-shell-{0}-{1}.zip'.format(ATOM_SHELL_VRESION,
+                                              TARGET_PLATFORM)
+  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
 
   with scoped_cwd(DIST_DIR):
     files = TARGET_BINARIES[TARGET_PLATFORM] +  \
index d3853fb491514aacbf522261b9c5150e79b7975c..7595b045eec9bf153215371c0d58eeb8d25bed33 100755 (executable)
@@ -10,8 +10,17 @@ import tempfile
 from lib.util import *
 
 
+TARGET_PLATFORM = {
+  'cygwin': 'win32',
+  'darwin': 'darwin',
+  'linux2': 'linux',
+  'win32': 'win32',
+}[sys.platform]
+
 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
+DIST_NAME = 'atom-shell-{0}-{1}.zip'.format(get_atom_shell_version(),
+                                            TARGET_PLATFORM)
 
 
 def main():
@@ -40,7 +49,7 @@ def dist_newer_than_head():
     try:
       head_time = subprocess.check_output(['git', 'log', '--pretty=format:%at',
                                            '-n', '1']).strip()
-      dist_time = os.path.getmtime(os.path.join(DIST_DIR, 'atom-shell.zip'))
+      dist_time = os.path.getmtime(os.path.join(DIST_DIR, DIST_NAME))
     except OSError as e:
       if e.errno != errno.ENOENT:
         raise
@@ -55,7 +64,7 @@ def upload():
 
   version = get_atom_shell_version()
   s3put(bucket, access_key, secret_key, DIST_DIR,
-        'atom-shell/{0}'.format(version), ['atom-shell.zip'])
+        'atom-shell/{0}'.format(version), [DIST_NAME])
   s3put(bucket, access_key, secret_key, DIST_DIR,
         'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))