Skip to content

Commit 7bda962

Browse files
refackMylesBorins
authored andcommitted
build: simplify if in setting of arg_paths
PR-URL: #12653 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 2d5e2e9 commit 7bda962

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tools/gyp_node.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,11 @@ def run_gyp(args):
2424
# GYP bug.
2525
# On msvs it will crash if it gets an absolute path.
2626
# On Mac/make it will crash if it doesn't get an absolute path.
27-
if sys.platform == 'win32':
28-
args.append(os.path.join(node_root, 'node.gyp'))
29-
common_fn = os.path.join(node_root, 'common.gypi')
30-
options_fn = os.path.join(node_root, 'config.gypi')
31-
options_fips_fn = os.path.join(node_root, 'config_fips.gypi')
32-
else:
33-
args.append(os.path.join(os.path.abspath(node_root), 'node.gyp'))
34-
common_fn = os.path.join(os.path.abspath(node_root), 'common.gypi')
35-
options_fn = os.path.join(os.path.abspath(node_root), 'config.gypi')
36-
options_fips_fn = os.path.join(os.path.abspath(node_root), 'config_fips.gypi')
27+
a_path = node_root if sys.platform == 'win32' else os.path.abspath(node_root)
28+
args.append(os.path.join(a_path, 'node.gyp'))
29+
common_fn = os.path.join(a_path, 'common.gypi')
30+
options_fn = os.path.join(a_path, 'config.gypi')
31+
options_fips_fn = os.path.join(a_path, 'config_fips.gypi')
3732

3833
if os.path.exists(common_fn):
3934
args.extend(['-I', common_fn])

0 commit comments

Comments
 (0)