chatccc 0.1.4 → 0.1.6
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/chatccc.mjs +2 -2
- package/package.json +1 -1
package/bin/chatccc.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
4
|
import { dirname, join } from "node:path";
|
|
6
5
|
|
|
7
6
|
const require = createRequire(import.meta.url);
|
|
8
|
-
|
|
7
|
+
// 相对 bin/chatccc.mjs 解析 package.json,包根目录不依赖 cwd,也不会多退一级到 node_modules
|
|
8
|
+
const pkgRoot = dirname(require.resolve("../package.json"));
|
|
9
9
|
const indexTs = join(pkgRoot, "src", "index.ts");
|
|
10
10
|
const tsxCli = require.resolve("tsx/cli");
|
|
11
11
|
|