From 37f405859f860738c4ef80700913c83a5beecb4c Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@atlassian.com>
Date: Fri, 28 Sep 2018 11:24:25 +1000
Subject: [PATCH] chore: fix out_dir usage in upload-symbols.py

---
 script/lib/util.py            |  2 ++
 script/upload-node-headers.py |  2 --
 script/upload-symbols.py      | 16 +++++++---------
 script/upload.py              |  2 --
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/script/lib/util.py b/script/lib/util.py
index a40f94b5b43..26593413976 100644
--- a/script/lib/util.py
+++ b/script/lib/util.py
@@ -303,6 +303,8 @@ def get_out_dir():
     out_dir = override
   return os.path.join(GN_SRC_DIR, 'out', out_dir)
 
+# NOTE: This path is not created by gn, it is used as a scratch zone by our
+#       upload scripts
 def get_dist_dir():
   return os.path.join(get_out_dir(), 'gen', 'electron_dist')
 
diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py
index a431e826aed..df8de4a65ba 100755
--- a/script/upload-node-headers.py
+++ b/script/upload-node-headers.py
@@ -9,8 +9,6 @@ import sys
 from lib.config import PLATFORM, get_target_arch, s3_config
 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
-#       directory
 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 DIST_DIR    = get_dist_dir()
 OUT_DIR     = get_out_dir()
diff --git a/script/upload-symbols.py b/script/upload-symbols.py
index d3cfe0cdcbe..2e9b4355810 100755
--- a/script/upload-symbols.py
+++ b/script/upload-symbols.py
@@ -5,26 +5,24 @@ import glob
 import sys
 
 from lib.config import PLATFORM, s3_config, enable_verbose_mode
-from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put
+from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put, \
+                     get_out_dir
 
-# TODO: Update this entire file to point at the correct file names in the out
-#       directory
 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
-DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
-RELEASE_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
+RELEASE_DIR = get_out_dir()
+GEN_DIR = os.path.join(RELEASE_DIR, 'gen')
 
 
 PROJECT_NAME = get_electron_branding()['project_name']
 PRODUCT_NAME = get_electron_branding()['product_name']
 
 if PLATFORM == 'win32':
-  SYMBOLS_DIR = os.path.join(DIST_DIR, 'symbols')
+  SYMBOLS_DIR = os.path.join(GEN_DIR, 'symbols')
 else:
-  SYMBOLS_DIR = os.path.join(DIST_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
+  SYMBOLS_DIR = os.path.join(GEN_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
 
 PDB_LIST = [
-  os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME)),
-  os.path.join(RELEASE_DIR, 'node.dll.pdb')
+  os.path.join(RELEASE_DIR, '{0}.exe.pdb'.format(PROJECT_NAME))
 ]
 
 
diff --git a/script/upload.py b/script/upload.py
index 8fc7aea01c5..394503de92f 100755
--- a/script/upload.py
+++ b/script/upload.py
@@ -34,8 +34,6 @@ DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
 PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')
 
 
-# TODO: Update this entire file to point at the correct file names in the out
-#       directory
 def main():
   args = parse_args()
   if  args.upload_to_s3: