chore: fix out_dir usage in upload-node-headers.py

This commit is contained in:
Samuel Attard 2018-09-27 16:48:07 +10:00
parent 363cf1dec2
commit c1705f2789
2 changed files with 11 additions and 8 deletions

View file

@ -303,3 +303,5 @@ def get_out_dir():
out_dir = override out_dir = override
return os.path.join(GN_SRC_DIR, 'out', out_dir) return os.path.join(GN_SRC_DIR, 'out', out_dir)
def get_dist_dir():
return os.path.join(get_out_dir(), 'gen', 'electron_dist')

View file

@ -7,13 +7,13 @@ import shutil
import sys import sys
from lib.config import PLATFORM, get_target_arch, s3_config from lib.config import PLATFORM, get_target_arch, s3_config
from lib.util import safe_mkdir, scoped_cwd, s3put from lib.util import safe_mkdir, scoped_cwd, s3put, get_out_dir, get_dist_dir
# TODO: Update this entire file to point at the correct file names in the out # TODO: Update this entire file to point at the correct file names in the out
# directory # directory
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') DIST_DIR = get_dist_dir()
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') OUT_DIR = get_out_dir()
def main(): def main():
args = parse_args() args = parse_args()
@ -31,6 +31,7 @@ def parse_args():
def upload_node(bucket, access_key, secret_key, version): def upload_node(bucket, access_key, secret_key, version):
safe_mkdir(DIST_DIR)
with scoped_cwd(DIST_DIR): with scoped_cwd(DIST_DIR):
s3put(bucket, access_key, secret_key, DIST_DIR, s3put(bucket, access_key, secret_key, DIST_DIR,
'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) 'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
@ -49,11 +50,11 @@ def upload_node(bucket, access_key, secret_key, version):
safe_mkdir(os.path.dirname(node_lib)) safe_mkdir(os.path.dirname(node_lib))
safe_mkdir(os.path.dirname(iojs_lib)) safe_mkdir(os.path.dirname(iojs_lib))
# Copy atom.lib to node.lib, iojs.lib and v4 node.lib # Copy electron.lib to node.lib and iojs.lib.
atom_lib = os.path.join(OUT_DIR, 'node.dll.lib') electron_lib = os.path.join(OUT_DIR, 'electron.lib')
shutil.copy2(atom_lib, node_lib) shutil.copy2(electron_lib, node_lib)
shutil.copy2(atom_lib, iojs_lib) shutil.copy2(electron_lib, iojs_lib)
shutil.copy2(atom_lib, v4_node_lib) shutil.copy2(electron_lib, v4_node_lib)
# Upload the node.lib. # Upload the node.lib.
s3put(bucket, access_key, secret_key, DIST_DIR, s3put(bucket, access_key, secret_key, DIST_DIR,