-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathresonix.mjs
More file actions
executable file
路34 lines (28 loc) 路 881 Bytes
/
Copy pathresonix.mjs
File metadata and controls
executable file
路34 lines (28 loc) 路 881 Bytes
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
#!/usr/bin/env node
import module from "node:module";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { spawn } from "node:child_process";
// Get the directory where the script is located
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const scriptDir = __dirname;
// https://nodejs.org/api/module.html#module-compile-cache
if (module.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
try {
module.enableCompileCache();
} catch {
// Ignore errors
}
}
// Forward all arguments to the actual CLI
const args = process.argv.slice(2);
const nodeBin = process.execPath;
const indexPath = path.join(scriptDir, "dist", "index.js");
const child = spawn(nodeBin, [indexPath, ...args], {
stdio: "inherit",
cwd: scriptDir,
env: process.env,
});
child.on("exit", (code) => {
process.exit(code || 0);
});