fnva 0.0.51 → 0.0.52

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/fnva.ps1 CHANGED
@@ -6,22 +6,30 @@ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
6
6
  $arch = if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "x64" }
7
7
  $platformDir = "win32-$arch"
8
8
 
9
- # Try native binary in npm package
10
- $binaryPath = Join-Path $scriptDir "..\platforms\$platformDir\fnva.exe"
11
- if (Test-Path $binaryPath) {
12
- & $binaryPath @args
13
- exit $LASTEXITCODE
14
- }
9
+ # Search paths for native binary (in priority order)
10
+ $searchPaths = @(
11
+ # npm global install: fnva.ps1 is in <prefix>/, binary is in <prefix>/node_modules/fnva/platforms/
12
+ (Join-Path $scriptDir "node_modules\fnva\platforms\$platformDir\fnva.exe"),
13
+ # npm global install (flat): binary next to fnva.ps1
14
+ (Join-Path $scriptDir "fnva.exe"),
15
+ # Source tree: fnva.ps1 is in bin/, binary is in platforms/
16
+ (Join-Path $scriptDir "..\platforms\$platformDir\fnva.exe"),
17
+ # Local dev build
18
+ (Join-Path $scriptDir "..\target\release\fnva.exe")
19
+ )
15
20
 
16
- # Fallback: local dev build
17
- $devPath = Join-Path $scriptDir "..\target\release\fnva.exe"
18
- if (Test-Path $devPath) {
19
- & $devPath @args
20
- exit $LASTEXITCODE
21
+ foreach ($binaryPath in $searchPaths) {
22
+ if (Test-Path $binaryPath) {
23
+ & $binaryPath @args
24
+ exit $LASTEXITCODE
25
+ }
21
26
  }
22
27
 
23
28
  # Last resort: node wrapper
24
- $nodeScript = Join-Path $scriptDir "fnva.js"
29
+ $nodeScript = Join-Path $scriptDir "node_modules\fnva\bin\fnva.js"
30
+ if (-not (Test-Path $nodeScript)) {
31
+ $nodeScript = Join-Path $scriptDir "fnva.js"
32
+ }
25
33
  if (Test-Path $nodeScript) {
26
34
  & node $nodeScript @args
27
35
  exit $LASTEXITCODE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fnva",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "description": "跨平台环境切换工具,支持 Java 和 LLM 环境配置",
5
5
  "author": "protagonistss",
6
6
  "license": "MIT",
Binary file
Binary file
Binary file
Binary file
Binary file