@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, env) {
4
+ async function exec(script, params, opt) {
5
5
  const cmd = [script, ...params].join(" ");
6
- await _exec(cmd, { env });
6
+ await _exec(cmd, opt);
7
7
  }
8
8
  function exists(path) {
9
9
  return existsSync(path);
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.9.2";
2
+ var version = "2.9.3";
3
3
 
4
4
  export {
5
5
  version
package/dist/x.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  version
4
- } from "./chunk-TEO3M6Z2.js";
4
+ } from "./chunk-PM26AGY7.js";
5
5
  import "./chunk-MLKGABMK.js";
6
6
 
7
7
  // src/x.ts
package/dist/xn.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  exec,
4
4
  exists,
5
5
  flagOptionToStringArray
6
- } from "./chunk-UW6XLRG7.js";
6
+ } from "./chunk-ELIYGHQS.js";
7
7
  import {
8
8
  version
9
- } from "./chunk-TEO3M6Z2.js";
9
+ } from "./chunk-PM26AGY7.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
 
12
12
  // src/xn.ts
package/dist/xr.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  exec
4
- } from "./chunk-UW6XLRG7.js";
4
+ } from "./chunk-ELIYGHQS.js";
5
5
  import {
6
6
  version
7
- } from "./chunk-TEO3M6Z2.js";
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
- await runScript(commandOrFile, params);
169
- } catch (error) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0x-jerry/x",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/0x-jerry/x.git"