fnva 0.0.52 → 0.0.53

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
@@ -18,10 +18,35 @@ $searchPaths = @(
18
18
  (Join-Path $scriptDir "..\target\release\fnva.exe")
19
19
  )
20
20
 
21
+ function Invoke-FnvaNative {
22
+ param([string]$BinPath, [string[]]$CliArgs)
23
+
24
+ # For env commands, capture output and re-emit as single string
25
+ # to avoid PS splitting native exe output into Object[]
26
+ if ($CliArgs.Length -ge 2 -and $CliArgs[0] -eq 'env' -and $CliArgs[1] -eq 'env') {
27
+ $output = & $BinPath @CliArgs 2>$null
28
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
29
+ $output -join "`n"
30
+ return
31
+ }
32
+
33
+ # For switch commands, also capture to avoid Object[] issues
34
+ if ($CliArgs.Length -ge 3 -and $CliArgs[1] -eq 'use') {
35
+ $output = & $BinPath @CliArgs 2>$null
36
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
37
+ $output -join "`n"
38
+ return
39
+ }
40
+
41
+ # Other commands: pass through directly
42
+ & $BinPath @CliArgs
43
+ exit $LASTEXITCODE
44
+ }
45
+
21
46
  foreach ($binaryPath in $searchPaths) {
22
47
  if (Test-Path $binaryPath) {
23
- & $binaryPath @args
24
- exit $LASTEXITCODE
48
+ Invoke-FnvaNative -BinPath $binaryPath -CliArgs $args
49
+ return
25
50
  }
26
51
  }
27
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fnva",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "跨平台环境切换工具,支持 Java 和 LLM 环境配置",
5
5
  "author": "protagonistss",
6
6
  "license": "MIT",
Binary file
Binary file
Binary file
Binary file
Binary file