fnva 0.0.46 → 0.0.47
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/README.md +3 -3
- package/bin/fnva.js +21 -0
- 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 +4 -4
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ Cross-platform environment switcher for Java, Claude Code (CC), and LLM setups.
|
|
|
14
14
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
|
-
- Init shell (Bash/Zsh): `eval "$(fnva env --shell bash)"`
|
|
18
|
-
PowerShell: `fnva env --shell powershell | Out-String | Invoke-Expression`
|
|
19
|
-
Fish: `fnva env --shell fish | source`
|
|
17
|
+
- Init shell (Bash/Zsh): `eval "$(fnva env env --shell bash)"`
|
|
18
|
+
PowerShell: `fnva env env --shell powershell | Out-String | Invoke-Expression`
|
|
19
|
+
Fish: `fnva env env --shell fish | source`
|
|
20
20
|
- Scan Java: `fnva java scan`
|
|
21
21
|
- Switch Java for current session: `fnva java use jdk-17` (with shell integration)
|
|
22
22
|
- Switch CC profile: `fnva cc use glmcc` (with shell integration)
|
package/bin/fnva.js
CHANGED
|
@@ -501,6 +501,27 @@ function run() {
|
|
|
501
501
|
}
|
|
502
502
|
const isSwitchCommand = isEnvironmentSwitchCommand(args);
|
|
503
503
|
|
|
504
|
+
// Unix: 直接透传给 Rust 二进制,不拦截参数
|
|
505
|
+
// shell wrapper 函数负责捕获输出并 source
|
|
506
|
+
if (process.platform !== 'win32') {
|
|
507
|
+
const result = spawnSync(binaryPath, args, {
|
|
508
|
+
stdio: 'inherit',
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
if (result.error) {
|
|
512
|
+
if (result.error.code === 'EACCES') {
|
|
513
|
+
console.error(`[ERROR] Permission denied. The fnva binary is not executable.`);
|
|
514
|
+
console.error(`[INFO] To fix this, run: sudo chmod +x "${binaryPath}"`);
|
|
515
|
+
console.error(`[INFO] Or reinstall: npm install -g fnva --force`);
|
|
516
|
+
} else {
|
|
517
|
+
console.error(`[ERROR] Failed to execute fnva: ${result.error.message}`);
|
|
518
|
+
}
|
|
519
|
+
process.exit(result.status ?? 1);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
process.exit(result.status ?? 0);
|
|
523
|
+
}
|
|
524
|
+
|
|
504
525
|
if (isSwitchCommand) {
|
|
505
526
|
const shellArg = getShellArg(args);
|
|
506
527
|
if (!shellArg || shellArg === 'auto') {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/platforms/linux-x64/fnva
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -41,12 +41,12 @@ function getShellConfigPath(shell) {
|
|
|
41
41
|
function getIntegrationLine(shell) {
|
|
42
42
|
switch (shell) {
|
|
43
43
|
case 'powershell':
|
|
44
|
-
return 'fnva env --shell powershell | Out-String | Invoke-Expression';
|
|
44
|
+
return 'fnva env env --shell powershell | Out-String | Invoke-Expression';
|
|
45
45
|
case 'bash':
|
|
46
46
|
case 'zsh':
|
|
47
|
-
return 'eval "$(fnva env --shell bash)"';
|
|
47
|
+
return 'eval "$(fnva env env --shell bash)"';
|
|
48
48
|
case 'fish':
|
|
49
|
-
return 'fnva env --shell fish | source';
|
|
49
|
+
return 'fnva env env --shell fish | source';
|
|
50
50
|
default:
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
@@ -57,7 +57,7 @@ function isInstalled(configPath) {
|
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
const content = fs.readFileSync(configPath, 'utf8');
|
|
60
|
-
return content.includes('fnva env --shell');
|
|
60
|
+
return content.includes('fnva env env --shell');
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function installShellIntegration() {
|