File tree 2 files changed +8
-12
lines changed
2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 2
2
"use strict" ;
3
3
4
4
var child_process = require ( "child_process" ) ;
5
- var path = require ( "path" ) ;
6
- var exe = path . join (
7
- __dirname ,
8
- process . platform === "darwin" && process . arch === "arm64"
9
- ? process . platform + process . arch
10
- : process . platform ,
11
- "bsc.exe"
12
- ) ;
5
+ var bsc_exe = require ( "./scripts/bin_path" ) . bsc_exe ;
6
+
13
7
var delegate_args = process . argv . slice ( 2 ) ;
14
8
15
9
try {
16
- child_process . execFileSync ( exe , delegate_args , { stdio : "inherit" } ) ;
10
+ child_process . execFileSync ( bsc_exe , delegate_args , { stdio : "inherit" } ) ;
17
11
} catch ( e ) {
18
12
if ( e . code === "ENOENT" ) {
19
13
console . error ( String ( e ) ) ;
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ var path = require("path");
4
4
5
5
/**
6
6
* @type {string }
7
+ *
8
+ * For compatibility reasons, if the architecture is x64, omit it from the bin directory name.
9
+ * So we'll have "darwin", "linux" and "win32" for x64 arch,
10
+ * but "darwinarm64" and "linuxarm64" for arm64 arch.
7
11
*/
8
12
var binDirName =
9
- process . platform === "darwin" && process . arch === "arm64"
10
- ? process . platform + process . arch
11
- : process . platform ;
13
+ process . arch === "x64" ? process . platform : process . platform + process . arch ;
12
14
13
15
/**
14
16
*
You can’t perform that action at this time.
0 commit comments