Use atom.gyp to generate paths in test.py

This commit is contained in:
Cheng Zhao 2015-04-12 22:10:02 +08:00
parent f8d64ef1e4
commit 6ba57dcfa3

View file

@ -4,9 +4,14 @@ import os
import subprocess
import sys
from lib.util import atom_gyp
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']
def main():
os.chdir(SOURCE_ROOT)
@ -16,12 +21,14 @@ def main():
config = 'R'
if sys.platform == 'darwin':
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'Atom.app',
'Contents', 'MacOS', 'Atom')
atom_shell = os.path.join(SOURCE_ROOT, 'out', config,
'{0}.app'.format(PRODUCT_NAME), 'Contents',
'MacOS', PRODUCT_NAME)
elif sys.platform == 'win32':
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom.exe')
atom_shell = os.path.join(SOURCE_ROOT, 'out', config,
'{0}.exe'.format(PROJECT_NAME))
else:
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom')
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)
subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:])