fnva 0.0.34 → 0.0.35
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.js +6 -13
- package/package.json +1 -1
- package/platforms/darwin-arm64/fnva +0 -0
- package/platforms/darwin-x64/fnva +0 -0
- package/platforms/linux-arm64/fnva +0 -0
- package/platforms/linux-x64/fnva +0 -0
- package/platforms/win32-x64/fnva.exe +0 -0
- package/scripts/install-shell-integration.js +6 -9
package/bin/fnva.js
CHANGED
|
@@ -44,11 +44,6 @@ function buildBinaryPath() {
|
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// 如果设置了 FNVA_AUTO_MODE,自动使用 Node.js 模式
|
|
48
|
-
if (process.env.FNVA_AUTO_MODE === '1') {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
47
|
const platform = resolvePlatform();
|
|
53
48
|
const binaryCandidates = [];
|
|
54
49
|
|
|
@@ -424,7 +419,6 @@ function run() {
|
|
|
424
419
|
console.log('Environment variables:');
|
|
425
420
|
console.log(' FNVA_DEBUG:', process.env.FNVA_DEBUG);
|
|
426
421
|
console.log(' FNVA_SKIP_NATIVE:', process.env.FNVA_SKIP_NATIVE);
|
|
427
|
-
console.log(' FNVA_AUTO_MODE:', process.env.FNVA_AUTO_MODE);
|
|
428
422
|
console.log('Command line args:', process.argv);
|
|
429
423
|
console.log('');
|
|
430
424
|
}
|
|
@@ -472,9 +466,9 @@ function run() {
|
|
|
472
466
|
}
|
|
473
467
|
|
|
474
468
|
if (!binaryPath) {
|
|
475
|
-
if (process.env.FNVA_SKIP_NATIVE === '1'
|
|
469
|
+
if (process.env.FNVA_SKIP_NATIVE === '1') {
|
|
476
470
|
if (showDebug) {
|
|
477
|
-
console.log('Falling back to Node.js mode (FNVA_SKIP_NATIVE
|
|
471
|
+
console.log('Falling back to Node.js mode (FNVA_SKIP_NATIVE set)');
|
|
478
472
|
}
|
|
479
473
|
// 纯 Node.js 模式 - 实现基本的环境切换功能
|
|
480
474
|
const args = process.argv.slice(2);
|
|
@@ -491,11 +485,10 @@ function run() {
|
|
|
491
485
|
}
|
|
492
486
|
|
|
493
487
|
console.error("💡 Solutions:");
|
|
494
|
-
console.error(" 1)
|
|
495
|
-
console.error(" 2)
|
|
496
|
-
console.error(" 3)
|
|
497
|
-
console.error(" 4) Set
|
|
498
|
-
console.error(" 5) Set FNVA_DEBUG=1 to show debug information");
|
|
488
|
+
console.error(" 1) Reinstall npm package: npm install -g fnva --force");
|
|
489
|
+
console.error(" 2) Download binary from GitHub Release");
|
|
490
|
+
console.error(" 3) Set FNVA_SKIP_NATIVE=1 to use Node.js mode (limited functionality)");
|
|
491
|
+
console.error(" 4) Set FNVA_DEBUG=1 to show debug information");
|
|
499
492
|
process.exit(1);
|
|
500
493
|
}
|
|
501
494
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/platforms/linux-x64/fnva
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -44,9 +44,8 @@ function fnva {
|
|
|
44
44
|
if ($args.Count -ge 2 -and ($args[0] -eq "java" -or $args[0] -eq "llm" -or $args[0] -eq "cc") -and ($args[1] -eq "use")) {
|
|
45
45
|
$tempFile = Join-Path $env:TEMP ("fnva_script_" + (Get-Random) + ".ps1")
|
|
46
46
|
|
|
47
|
-
$env:FNVAAUTOMODE = "1"
|
|
48
47
|
try {
|
|
49
|
-
$output = cmd.exe /c "
|
|
48
|
+
$output = cmd.exe /c "fnva $args" 2>&1
|
|
50
49
|
|
|
51
50
|
if ($output -match '\\$env:' -or $output -match 'Write-Host') {
|
|
52
51
|
$output | Out-File -FilePath $tempFile -Encoding UTF8
|
|
@@ -55,12 +54,10 @@ function fnva {
|
|
|
55
54
|
$output
|
|
56
55
|
}
|
|
57
56
|
} finally {
|
|
58
|
-
$env:FNVAAUTOMODE = ""
|
|
59
57
|
if (Test-Path $tempFile) { Remove-Item $tempFile -ErrorAction SilentlyContinue }
|
|
60
58
|
}
|
|
61
59
|
} else {
|
|
62
|
-
|
|
63
|
-
try { cmd.exe /c "set FNVA_AUTO_MODE=%FNVAAUTOMODE% && fnva $args" } finally { $env:FNVAAUTOMODE = "" }
|
|
60
|
+
try { cmd.exe /c "fnva $args" } finally { }
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
`;
|
|
@@ -96,11 +93,11 @@ fnva() {
|
|
|
96
93
|
temp_file="$(mktemp)"
|
|
97
94
|
chmod +x "$temp_file"
|
|
98
95
|
|
|
99
|
-
|
|
96
|
+
"$__fnva_bin" "$@" > "$temp_file"
|
|
100
97
|
source "$temp_file"
|
|
101
98
|
rm -f "$temp_file"
|
|
102
99
|
else
|
|
103
|
-
|
|
100
|
+
"$__fnva_bin" "$@"
|
|
104
101
|
fi
|
|
105
102
|
}
|
|
106
103
|
`;
|
|
@@ -119,11 +116,11 @@ function fnva
|
|
|
119
116
|
if test (count $argv) -ge 2; and string match -q -r "^(java|llm|cc)$" $argv[1]; and test $argv[2] = "use"
|
|
120
117
|
set temp_file (mktemp)
|
|
121
118
|
chmod +x $temp_file
|
|
122
|
-
env
|
|
119
|
+
env "$__fnva_bin" $argv > $temp_file
|
|
123
120
|
source $temp_file
|
|
124
121
|
rm -f $temp_file
|
|
125
122
|
else
|
|
126
|
-
env
|
|
123
|
+
env "$__fnva_bin" $argv
|
|
127
124
|
end
|
|
128
125
|
end
|
|
129
126
|
`;
|