fnva 0.0.29 → 0.0.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fnva",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "跨平台环境切换工具,支持 Java 和 LLM 环境配置",
5
5
  "author": "protagonistss",
6
6
  "license": "MIT",
package/platforms/fnva CHANGED
Binary file
Binary file
@@ -7,6 +7,9 @@ const fs = require('fs');
7
7
  const path = require('path');
8
8
  const os = require('os');
9
9
 
10
+ // Absolute path to the packaged fnva shim (bin/fnva.js)
11
+ const FNVA_SHIM = path.resolve(__dirname, '..', 'bin', 'fnva.js');
12
+
10
13
  function detectShell() {
11
14
  if (process.platform === 'win32') {
12
15
  return 'powershell';
@@ -82,9 +85,8 @@ function getBashFunction() {
82
85
  return `
83
86
  # fnva auto integration (added by npm install)
84
87
  fnva() {
85
- local __fnva_bin
86
- __fnva_bin="$(command -v fnva | head -n 1)"
87
- if [[ -z "$__fnva_bin" || ! -x "$__fnva_bin" ]]; then
88
+ local __fnva_bin="${FNVA_SHIM}"
89
+ if [[ ! -x "$__fnva_bin" ]]; then
88
90
  echo "fnva: binary not found in PATH" >&2
89
91
  return 127
90
92
  fi
@@ -108,8 +110,8 @@ function getFishFunction() {
108
110
  return `
109
111
  # fnva auto integration (added by npm install)
110
112
  function fnva
111
- set __fnva_bin (command -v fnva | head -n 1)
112
- if test -z "$__fnva_bin"
113
+ set __fnva_bin "${FNVA_SHIM}"
114
+ if test ! -x "$__fnva_bin"
113
115
  echo "fnva: binary not found in PATH" >&2
114
116
  return 127
115
117
  end
@@ -239,4 +241,4 @@ module.exports = {
239
241
  getShellFunction,
240
242
  isFunctionInstalled,
241
243
  installShellIntegration,
242
- };
244
+ };