fnva 0.0.49 → 0.0.50
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 +1 -1
- package/bin/fnva.js +25 -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 +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Cross-platform environment switcher for Java, Claude Code (CC), and LLM setups.
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
17
|
- Init shell (Bash/Zsh): `eval "$(fnva env env --shell bash)"`
|
|
18
|
-
PowerShell: `
|
|
18
|
+
PowerShell: `fnva env env --shell powershell | Out-String | Invoke-Expression`
|
|
19
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)
|
package/bin/fnva.js
CHANGED
|
@@ -651,6 +651,31 @@ function run() {
|
|
|
651
651
|
|
|
652
652
|
process.exit(0);
|
|
653
653
|
} else {
|
|
654
|
+
// For env commands, capture output and write as single string to avoid
|
|
655
|
+
// PowerShell splitting multi-line output into Object[] (which breaks
|
|
656
|
+
// the standard | Out-String | Invoke-Expression profile pattern).
|
|
657
|
+
const isEnvOutputCommand = args[0] === 'env' && args[1] === 'env';
|
|
658
|
+
if (isEnvOutputCommand) {
|
|
659
|
+
const result = spawnSync(binaryPath, args, {
|
|
660
|
+
encoding: 'utf8',
|
|
661
|
+
shell: false,
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
if (result.error) {
|
|
665
|
+
console.error(`[ERROR] Failed to execute fnva: ${result.error.message}`);
|
|
666
|
+
process.exit(result.status ?? 1);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (result.stdout) {
|
|
670
|
+
process.stdout.write(result.stdout);
|
|
671
|
+
}
|
|
672
|
+
if (result.stderr) {
|
|
673
|
+
process.stderr.write(result.stderr);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
process.exit(result.status ?? 0);
|
|
677
|
+
}
|
|
678
|
+
|
|
654
679
|
// 对于其他命令,使用原有的 stdio: 'inherit' 方式
|
|
655
680
|
const result = spawnSync(binaryPath, args, {
|
|
656
681
|
stdio: 'inherit',
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/platforms/linux-x64/fnva
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -50,7 +50,7 @@ function getShellConfigPath(shell) {
|
|
|
50
50
|
function getIntegrationLine(shell) {
|
|
51
51
|
switch (shell) {
|
|
52
52
|
case 'powershell':
|
|
53
|
-
return '
|
|
53
|
+
return 'fnva env env --shell powershell | Out-String | Invoke-Expression';
|
|
54
54
|
case 'bash':
|
|
55
55
|
case 'zsh':
|
|
56
56
|
return 'eval "$(fnva env env --shell bash)"';
|