@0x-jerry/x 2.9.2 → 2.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/utils.ts
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { exec as _exec } from "@0x-jerry/utils/node";
|
|
4
|
-
async function exec(script, params,
|
|
4
|
+
async function exec(script, params, opt) {
|
|
5
5
|
const cmd = [script, ...params].join(" ");
|
|
6
|
-
await _exec(cmd,
|
|
6
|
+
await _exec(cmd, opt);
|
|
7
7
|
}
|
|
8
8
|
function exists(path) {
|
|
9
9
|
return existsSync(path);
|
package/dist/x.js
CHANGED
package/dist/xn.js
CHANGED
package/dist/xr.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
exec
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ELIYGHQS.js";
|
|
5
5
|
import {
|
|
6
6
|
version
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PM26AGY7.js";
|
|
8
8
|
import "./chunk-MLKGABMK.js";
|
|
9
9
|
|
|
10
10
|
// src/xr.ts
|
|
@@ -111,7 +111,7 @@ async function runScript(command, params = []) {
|
|
|
111
111
|
const task = await taskDetector.task(cwd, command);
|
|
112
112
|
if (task) {
|
|
113
113
|
const env = makeEnv(await taskDetector.binaryPaths?.(cwd) || []);
|
|
114
|
-
await exec(task, params, env);
|
|
114
|
+
await exec(task, params, { env });
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -156,17 +156,17 @@ ins.type("command", async () => {
|
|
|
156
156
|
});
|
|
157
157
|
async function defaultAction(_, arg) {
|
|
158
158
|
const [commandOrFile, ...params] = arg._;
|
|
159
|
-
if (isJsFile(commandOrFile)) {
|
|
160
|
-
await exec("node", [
|
|
161
|
-
"--import",
|
|
162
|
-
import.meta.resolve(`./hooks/register.js`),
|
|
163
|
-
commandOrFile
|
|
164
|
-
]);
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
159
|
try {
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
if (isJsFile(commandOrFile)) {
|
|
161
|
+
await exec(
|
|
162
|
+
"node",
|
|
163
|
+
["--import", import.meta.resolve(`./hooks/register.js`), commandOrFile],
|
|
164
|
+
{ silent: true }
|
|
165
|
+
);
|
|
166
|
+
} else {
|
|
167
|
+
await runScript(commandOrFile, params);
|
|
168
|
+
}
|
|
169
|
+
} catch (_error) {
|
|
170
170
|
process.exit(1);
|
|
171
171
|
}
|
|
172
172
|
}
|