pi-bridge 0.1.9 → 0.2.2

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.
Files changed (2) hide show
  1. package/bin/pii.js +15 -1
  2. package/package.json +1 -1
package/bin/pii.js CHANGED
@@ -6,14 +6,28 @@ const path = require('path');
6
6
  const fs = require('fs');
7
7
  const os = require('os');
8
8
 
9
+ const pkg = require('../package.json');
9
10
  const preload = path.join(__dirname, '..', 'src', 'local', 'preload.js');
10
11
 
12
+ if (process.argv.includes('--version') || process.argv.includes('-v') || process.argv.includes('--v')) {
13
+ process.stdout.write('pi-bridge/' + pkg.version + '\n');
14
+ process.exit(0);
15
+ }
16
+
11
17
  function findCli() {
12
18
  // 1. Standard npm global: pi-bridge and pi share the same node_modules prefix
13
19
  const shared = path.resolve(__dirname, '..', '..', '@mariozechner', 'pi-coding-agent', 'dist', 'cli.js');
14
20
  if (fs.existsSync(shared)) return shared;
15
21
 
16
- // 2. Windows bundled/custom install: pi.js sits next to pi.ps1 (no node_modules structure)
22
+ // 2. Unix GitHub clone: which pi returns the JS file directly
23
+ if (os.platform() !== 'win32') {
24
+ try {
25
+ const wrapper = execFileSync('which', ['pi'], { encoding: 'utf8' }).trim();
26
+ if (fs.existsSync(wrapper)) return wrapper;
27
+ } catch (_) {}
28
+ }
29
+
30
+ // 3. Windows fallback: PowerShell Get-Command finds pi even in custom/non-PATH locations
17
31
  if (os.platform() === 'win32') {
18
32
  try {
19
33
  const wrapper = execFileSync(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bridge",
3
- "version": "0.1.9",
3
+ "version": "0.2.2",
4
4
  "description": "Transparent filesystem bridge that makes pi run natively on a remote machine over SSH",
5
5
  "type": "commonjs",
6
6
  "bin": {