forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbin_path.js
45 lines (37 loc) · 992 Bytes
/
bin_path.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//@ts-check
var path = require("path");
/**
* @type{string}
*
* For compatibility reasons, if the architecture is x64, omit it from the bin directory name.
* So we'll have "darwin", "linux" and "win32" for x64 arch,
* but "darwinarm64" and "linuxarm64" for arm64 arch.
*/
var binDirName =
process.arch === "x64" ? process.platform : process.platform + process.arch;
// Deactivate support for macos-arm for now
if (binDirName === "darwinarm64") {
binDirName = "darwin";
}
/**
*
* @type{string}
*/
var binAbsolutePath = path.join(__dirname, "..", binDirName);
/**
* @type{string}
*/
var bsc_exe = path.join(binAbsolutePath, "bsc.exe");
/**
* @type{string}
*/
var ninja_exe = path.join(binAbsolutePath, "ninja.exe");
/**
* @type{string}
*/
var rescript_exe = path.join(binAbsolutePath, "rescript.exe");
exports.dirName = binDirName;
exports.absolutePath = binAbsolutePath;
exports.bsc_exe = bsc_exe;
exports.ninja_exe = ninja_exe;
exports.rescript_exe = rescript_exe;