node-version-bridge 0.6.0 → 0.6.1

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 CHANGED
@@ -178,6 +178,6 @@ bash test/run.sh
178
178
 
179
179
  ## Status
180
180
 
181
- v0.6.0 — automatic shell hook setup, `nvb setup` and `nvb init` commands. See [Changelog](./CHANGELOG.md).
181
+ v0.6.1 — automatic shell hook setup, `nvb setup` and `nvb init` commands. See [Changelog](./CHANGELOG.md).
182
182
 
183
183
  **[Full Documentation](https://marcosreuquen.github.io/node-version-bridge/)**
package/bin/nvb CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  set -euo pipefail
7
7
 
8
- NVB_VERSION="0.6.0"
8
+ NVB_VERSION="0.6.1"
9
9
 
10
10
  # Resolve script location (handles symlinks on macOS/Linux)
11
11
  _nvb_resolve_root() {
@@ -46,8 +46,8 @@ nvb_cmd_refresh() {
46
46
  return 0
47
47
  fi
48
48
 
49
- # Check cache — skip if nothing changed
50
- if nvb_cache_is_current "$PWD" "$resolved_version" "$resolved_source"; then
49
+ # Check cache — skip if nothing changed (bypass with NVB_FORCE_REFRESH=1)
50
+ if [[ "${NVB_FORCE_REFRESH:-}" != "1" ]] && nvb_cache_is_current "$PWD" "$resolved_version" "$resolved_source"; then
51
51
  nvb_log debug "Cache hit: ${resolved_version} from ${resolved_source}"
52
52
  return 0
53
53
  fi
@@ -248,7 +248,8 @@ _nvb_hook() {
248
248
  }
249
249
  autoload -U add-zsh-hook
250
250
  add-zsh-hook chpwd _nvb_hook
251
- _nvb_hook
251
+ eval "$(NVB_FORCE_REFRESH=1 nvb refresh 2>/dev/null)"
252
+ _NVB_LAST_DIR="$PWD"
252
253
  HOOK
253
254
  ;;
254
255
  bash)
@@ -261,6 +262,8 @@ _nvb_hook() {
261
262
  if [[ ";${PROMPT_COMMAND:-};" != *";_nvb_hook;"* ]]; then
262
263
  PROMPT_COMMAND="_nvb_hook;${PROMPT_COMMAND:-}"
263
264
  fi
265
+ eval "$(NVB_FORCE_REFRESH=1 nvb refresh 2>/dev/null)"
266
+ _NVB_LAST_DIR="$PWD"
264
267
  HOOK
265
268
  ;;
266
269
  *)
package/hooks/nvb.bash CHANGED
@@ -16,3 +16,7 @@ _nvb_hook() {
16
16
  if [[ ";${PROMPT_COMMAND:-};" != *";_nvb_hook;"* ]]; then
17
17
  PROMPT_COMMAND="_nvb_hook;${PROMPT_COMMAND:-}"
18
18
  fi
19
+
20
+ # Force refresh on shell start (cache may be stale from previous session)
21
+ eval "$(NVB_FORCE_REFRESH=1 "${_NVB_BIN}" refresh 2>/dev/null)"
22
+ _NVB_LAST_DIR="$PWD"
package/hooks/nvb.zsh CHANGED
@@ -15,5 +15,6 @@ _nvb_hook() {
15
15
  autoload -U add-zsh-hook
16
16
  add-zsh-hook chpwd _nvb_hook
17
17
 
18
- # Run once on shell start
19
- _nvb_hook
18
+ # Force refresh on shell start (cache may be stale from previous session)
19
+ eval "$(NVB_FORCE_REFRESH=1 "${_NVB_BIN}" refresh 2>/dev/null)"
20
+ _NVB_LAST_DIR="$PWD"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-version-bridge",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Detect Node.js version from project files and apply it via any version manager",
5
5
  "bin": {
6
6
  "nvb": "bin/nvb"