Skip to content

Commit bcd94bd

Browse files
committed
fix bin path
1 parent 345c93c commit bcd94bd

File tree

10 files changed

+13
-12
lines changed

10 files changed

+13
-12
lines changed

cli/bsc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { execFileSync } from "node:child_process";
66

7-
import { bsc_exe } from "#cli/paths";
7+
import { bsc_exe } from "./common/bins.js";
88

99
const delegate_args = process.argv.slice(2);
1010

cli/common/paths.js renamed to cli/common/bins.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import * as path from "node:path";
44

5-
export const cliPath = path.join(import.meta.dirname, "../rescript.js");
6-
75
/**
86
* For compatibility reasons, if the architecture is x64, omit it from the bin directory name.
97
* So we'll have "darwin", "linux" and "win32" for x64 arch,
@@ -19,6 +17,7 @@ export const platformName =
1917
export const platformDir = path.resolve(
2018
import.meta.dirname,
2119
"..",
20+
"..",
2221
platformName,
2322
);
2423

cli/common/bsb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as os from "node:os";
77
import * as path from "node:path";
88
import { WebSocket } from "#lib/minisocket";
99

10-
import { rescript_exe } from "./paths.js";
10+
import { rescript_exe } from "./bins.js";
1111

1212
const cwd = process.cwd();
1313
const lockFileName = path.join(cwd, ".bsb.lock");

cli/rescript-tools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import * as child_process from "node:child_process";
66

7-
import { rescript_tools_exe } from "#cli/paths";
7+
import { rescript_tools_exe } from "./common/bins.js";
88

99
const args = process.argv.slice(2);
1010

cli/rescript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import * as tty from "node:tty";
1010
import packageJson from "rescript/package.json" with { type: "json" };
1111

12-
import * as bsb from "#cli/bsb";
13-
import { bsc_exe, rescript_exe } from "#cli/paths";
12+
import { bsc_exe, rescript_exe } from "./common/bins.js";
13+
import * as bsb from "./common/bsb.js";
1414

1515
const cwd = process.cwd();
1616
process.env.BSB_PROJECT_ROOT = cwd;

cli/rewatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @ts-check
44

55
import * as child_process from "node:child_process";
6-
import { rewatch_exe } from "#cli/paths";
6+
import { rewatch_exe } from "./common/bins.js";
77

88
const args = process.argv.slice(2);
99

lib_dev/process.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as child_process from "node:child_process";
2-
import { bsc_exe, cliPath, rescript_exe } from "#cli/paths";
2+
import * as path from "node:path";
3+
import { bsc_exe, rescript_exe } from "#cli/bins";
34

45
/**
56
* @typedef {{
@@ -135,6 +136,7 @@ export function setup(cwd = process.cwd()) {
135136
* @return {Promise<ExecResult>}
136137
*/
137138
rescript(command, args = [], options = {}) {
139+
const cliPath = path.join(import.meta.dirname, "../cli/rescript.js");
138140
return exec("node", [cliPath, command, ...args].filter(Boolean), options);
139141
},
140142

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"./package.json": "./package.json"
7474
},
7575
"imports": {
76-
"#cli/*": "./cli/common/*.js",
76+
"#cli/bins": "./cli/common/bins.js",
7777
"#dev/*": "./lib_dev/*.js",
7878
"#lib/minisocket": "./lib/minisocket.js"
7979
},

runtime/RescriptTools.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ You can use this when you're already running a JS process and want to avoid the
1111
let stringifiedJson = ChildProcess.execFileSync(RescriptTools.binaryPath, ["-v"])
1212
```
1313
*/
14-
@module("#cli/paths")
14+
@module("#cli/bins")
1515
external binaryPath: string = "rescript_tools_exe"

scripts/copyExes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import * as child_process from "node:child_process";
88
import * as fs from "node:fs";
99
import * as path from "node:path";
10-
import { platformDir } from "#cli/paths";
10+
import { platformDir } from "#cli/bins";
1111
import { compilerBinDir, ninjaDir, rewatchDir } from "#dev/paths";
1212

1313
fs.mkdirSync(platformDir, { recursive: true });

0 commit comments

Comments
 (0)