pi-bridge 0.1.2 → 0.1.4
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/pii.js +3 -2
- package/package.json +1 -1
package/bin/pii.js
CHANGED
|
@@ -19,8 +19,9 @@ const os = require('os');
|
|
|
19
19
|
const preload = path.join(__dirname, '..', 'src', 'local', 'preload.js');
|
|
20
20
|
|
|
21
21
|
function findPiCli() {
|
|
22
|
-
// npm root -g gives the exact global node_modules dir on all platforms
|
|
23
|
-
|
|
22
|
+
// npm root -g gives the exact global node_modules dir on all platforms.
|
|
23
|
+
// Use shell:true so Windows can resolve npm.cmd without ENOENT.
|
|
24
|
+
const npmRoot = execFileSync('npm', ['root', '-g'], { encoding: 'utf8', shell: true }).trim();
|
|
24
25
|
const cli = path.join(npmRoot, '@mariozechner', 'pi-coding-agent', 'dist', 'cli.js');
|
|
25
26
|
|
|
26
27
|
if (!fs.existsSync(cli)) {
|