comp-hub 0.0.104 → 0.0.106

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.
package/bin/cli.js CHANGED
@@ -4,8 +4,12 @@ const path = require("path");
4
4
  const { spawn } = require("child_process");
5
5
 
6
6
  const appPkgPath = require.resolve("comp-hub/package.json");
7
-
8
7
  const appRoot = path.dirname(appPkgPath);
9
-
10
8
  const appEntry = path.join(appRoot, "dist/index.js");
11
- spawn("node", [appEntry], { stdio: "inherit", shell: true });
9
+
10
+ // 获取命令行参数(排除 node 路径和当前文件路径)
11
+ // process.argv 结构:[node执行路径, 当前文件路径, ...用户传入的参数]
12
+ const args = process.argv.slice(2);
13
+
14
+ // 将参数传递给子进程
15
+ spawn("node", [appEntry, ...args], { stdio: "inherit", shell: true });