bvm-core 1.1.13 → 1.1.15

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/install.sh CHANGED
@@ -2,21 +2,14 @@
2
2
  set -e
3
3
 
4
4
  # --- Configuration ---
5
- DEFAULT_BVM_VERSION="v1.1.13" # Fallback
6
- FALLBACK_BUN_VERSION="1.3.5"
5
+ DEFAULT_BVM_VERSION="v1.1.15" # Fallback
6
+ FALLBACK_BUN_VERSION="1.3.6"
7
7
  BVM_SRC_VERSION="${BVM_INSTALL_VERSION}" # If empty, will resolve dynamically
8
8
 
9
- # --- Colors (Matches src/utils/ui.ts) ---
9
+ # --- Colors ---
10
10
  if [ -t 1 ]; then
11
- RED="\033[1;31m"
12
- GREEN="\033[1;32m"
13
- YELLOW="\033[1;33m"
14
- BLUE="\033[1;34m"
15
- CYAN="\033[1;36m"
16
- GRAY="\033[90m"
17
- BOLD="\033[1m"
18
- DIM="\033[2m"
19
- RESET="\033[0m"
11
+ RED="\033[1;31m" GREEN="\033[1;32m" YELLOW="\033[1;33m" BLUE="\033[1;34m"
12
+ CYAN="\033[1;36m" GRAY="\033[90m" BOLD="\033[1m" DIM="\033[2m" RESET="\033[0m"
20
13
  else
21
14
  RED="" GREEN="" YELLOW="" BLUE="" CYAN="" GRAY="" BOLD="" DIM="" RESET=""
22
15
  fi
@@ -28,42 +21,22 @@ BVM_RUNTIME_DIR="${BVM_DIR}/runtime"
28
21
  BVM_BIN_DIR="${BVM_DIR}/bin"
29
22
  BVM_SHIMS_DIR="${BVM_DIR}/shims"
30
23
  BVM_ALIAS_DIR="${BVM_DIR}/aliases"
31
- TEMP_DIR=""
24
+ BVM_VERSIONS_DIR="${BVM_DIR}/versions"
32
25
 
33
26
  # --- Helpers ---
34
- cleanup() {
35
- # Restore cursor just in case
36
- printf "\033[?25h"
37
- if [ -n "$TEMP_DIR" ] && [ -d "$TEMP_DIR" ]; then
38
- rm -rf "$TEMP_DIR"
39
- fi
40
- }
41
- trap cleanup EXIT
42
-
43
27
  info() { echo -e "${BLUE}ℹ${RESET} $1"; }
44
28
  success() { echo -e "${GREEN}✓${RESET} $1"; }
45
29
  warn() { echo -e "${YELLOW}?${RESET} $1"; }
46
30
  error() { echo -e "${RED}✖${RESET} $1"; exit 1; }
47
31
 
48
- # Usage: download_file <url> <dest> <description>
49
32
  download_file() {
50
- local url="$1"
51
- local dest="$2"
52
- local desc="$3"
53
-
54
- # Print description without newline
33
+ local url="$1" dest="$2" desc="$3"
55
34
  echo -n -e "${BLUE}ℹ${RESET} $desc "
56
-
57
- # Start download in background (Silent but show errors, fail on error)
58
35
  curl -L -s -S -f "$url" -o "$dest" &
59
36
  local pid=$!
60
-
61
37
  local delay=0.1
62
38
  local spinstr='|/-\'
63
-
64
- # Hide cursor
65
39
  printf "\033[?25l"
66
-
67
40
  while kill -0 "$pid" 2>/dev/null; do
68
41
  local temp=${spinstr#?}
69
42
  printf "${CYAN}%c${RESET}" "$spinstr"
@@ -71,255 +44,154 @@ download_file() {
71
44
  sleep $delay
72
45
  printf "\b"
73
46
  done
74
-
75
- # Restore cursor
76
47
  printf "\033[?25h"
77
-
78
48
  wait "$pid"
79
- local ret=$?
80
-
81
- if [ $ret -eq 0 ]; then
82
- echo -e "${GREEN}Done${RESET}"
83
- else
84
- echo -e "${RED}Failed${RESET}"
85
- return 1
86
- fi
49
+ [ $? -eq 0 ] && echo -e "${GREEN}Done${RESET}" || (echo -e "${RED}Failed${RESET}"; return 1)
87
50
  }
88
51
 
89
- # 0. Smart Network Detection (CN vs Global)
90
52
  detect_network_zone() {
91
- if [ -n "$BVM_REGION" ]; then
92
- echo "$BVM_REGION"
93
- return
94
- fi
95
-
96
- # Test connectivity to unpkg vs elemecdn
97
- # We use a short timeout for the race
98
- if [ -n "$BVM_TEST_FORCE_CN" ]; then
99
- echo "cn"
100
- elif [ -n "$BVM_TEST_FORCE_GLOBAL" ]; then
101
- echo "global"
102
- elif curl -s -m 1.5 https://npm.elemecdn.com > /dev/null; then
103
- # Usually elemecdn is much faster in CN
104
- echo "cn"
105
- else
106
- echo "global"
53
+ [ -n "$BVM_REGION" ] && echo "$BVM_REGION" && return
54
+ if [ -n "$BVM_TEST_FORCE_CN" ]; then echo "cn"
55
+ elif [ -n "$BVM_TEST_FORCE_GLOBAL" ]; then echo "global"
56
+ elif curl -s -m 1.5 https://npm.elemecdn.com > /dev/null; then echo "cn"
57
+ else echo "global"
107
58
  fi
108
59
  }
109
60
 
110
61
  detect_shell() {
111
62
  local shell_name=""
112
-
113
- # 1. Try to detect from parent process (PPID)
114
- # Check if ps supports -p and -o (POSIX-ish)
115
63
  if command -v ps >/dev/null 2>&1; then
116
- # Try standard POSIX syntax first
117
64
  local proc_name
118
65
  proc_name=$(ps -p "$PPID" -o comm= 2>/dev/null)
119
- if [ -n "$proc_name" ]; then
120
- shell_name="${proc_name##*/}"
121
- fi
66
+ [ -n "$proc_name" ] && shell_name="${proc_name##*/}"
122
67
  fi
123
-
124
- # Clean up shell name (remove leading hyphen for login shells)
125
68
  shell_name="${shell_name#-}"
126
-
127
69
  case "$shell_name" in
128
70
  *zsh) echo "zsh" ;;
129
71
  *bash) echo "bash" ;;
130
72
  *fish) echo "fish" ;;
131
- *)
132
- # 2. Fallback to SHELL environment variable
133
- if [ -n "$SHELL" ]; then
134
- echo "${SHELL##*/}"
135
- else
136
- echo "unknown"
137
- fi
138
- ;;
73
+ *) [ -n "$SHELL" ] && echo "${SHELL##*/}" || echo "unknown" ;;
139
74
  esac
140
75
  }
141
76
 
142
77
  # --- Main Script ---
143
-
144
78
  BVM_REGION=$(detect_network_zone)
145
-
146
79
  if [ "$BVM_REGION" == "cn" ]; then
147
80
  REGISTRY="registry.npmmirror.com"
148
- NPM_CDN="https://npm.elemecdn.com"
149
81
  else
150
82
  REGISTRY="registry.npmjs.org"
151
- NPM_CDN="https://unpkg.com"
152
83
  fi
153
84
 
154
- echo -e "${CYAN}"
155
- echo -e "__________ "
156
- echo -e "\\______ \\__ _______ "
157
- echo -e " | | _| \\/ / \\ "
158
- echo -e " | | \\\\ / Y Y \\ "
159
- echo -e " |______ / \\_/|__|_| / "
160
- echo -e " \\/ \\/ "
161
- echo -e "${RESET}"
162
- echo -e ""
163
- echo -e "${CYAN}${BOLD}BVM Installer${RESET} ${DIM}(${BVM_REGION})${RESET}"
164
- echo -e ""
85
+ echo -e "${CYAN}__________ \n\______ \__ _______ \n | | _| \/ / \ \n | | \\ / Y Y \ \n |______ / \_/|__|_| / \n \/ \/ ${RESET}
86
+ "
87
+ echo -e "${CYAN}${BOLD}BVM Installer${RESET} ${DIM}(${BVM_REGION})${RESET}
88
+ "
165
89
 
166
- # 1. Resolve BVM and Bun Versions
167
- # --- 0. Conflict Detection ---
168
- BVM_BIN_PATH="${BVM_DIR}/bin/bvm"
90
+ # 1. Conflict Detection
91
+ BVM_BIN_PATH="${BVM_BIN_DIR}/bvm"
169
92
  if [ -f "$BVM_BIN_PATH" ]; then
170
93
  if grep -q 'BVM_INSTALL_SOURCE="npm"' "$BVM_BIN_PATH"; then
171
- error "BVM was installed via npm. Please use 'npm update -g bvm-core' or 'bvm upgrade' to upgrade."
172
- error "If you want to switch to native installation, uninstall the npm version first."
173
- exit 1
94
+ error "BVM was installed via npm. Please use 'npm install -g bvm-core' or 'bvm upgrade' to upgrade."
95
+ elif grep -q 'BVM_INSTALL_SOURCE="bun"' "$BVM_BIN_PATH"; then
96
+ error "BVM was installed via bun. Please use 'bun install -g bvm-core' or 'bvm upgrade' to upgrade."
174
97
  fi
175
98
  fi
176
99
 
100
+ # 2. Resolve BVM Version
177
101
  echo -n -e "${BLUE}ℹ${RESET} Resolving versions... "
178
-
179
- # Resolve BVM Version dynamically if not provided
180
102
  if [ -z "$BVM_SRC_VERSION" ]; then
181
- if [ -f "./dist/index.js" ] && [ -f "./package.json" ]; then
182
- # Check actual version of the binary if possible
183
- if command -v bun >/dev/null 2>&1; then
184
- ACTUAL_VER=$(bun ./dist/index.js --version 2>/dev/null || echo "")
185
- if [ -n "$ACTUAL_VER" ]; then
186
- BVM_SRC_VERSION="v$ACTUAL_VER"
187
- info "Using local BVM binary: $BVM_SRC_VERSION"
188
- fi
189
- fi
190
-
191
- if [ -z "$BVM_SRC_VERSION" ]; then
192
- # Fallback to package.json
193
- BVM_SRC_VERSION="v$(grep -oE '"version": "[^"]+"' package.json | cut -d'"' -f4 || echo "0.0.0")"
194
- info "Using local version from package.json: $BVM_SRC_VERSION"
195
- fi
196
- else
197
- BVM_LATEST=$(curl -s https://${REGISTRY}/bvm-core | grep -oE '"dist-tags":\{"latest":"[^"]+"\}' | cut -d'"' -f6 || echo "")
198
- if [ -n "$BVM_LATEST" ]; then
199
- BVM_SRC_VERSION="v$BVM_LATEST"
200
- else
201
- BVM_SRC_VERSION="$DEFAULT_BVM_VERSION"
202
- fi
203
- fi
103
+ BVM_LATEST=$(curl -s https://${REGISTRY}/bvm-core | grep -oE '"dist-tags":\{"latest":"[^" ]+"\}' | cut -d'"' -f6 || echo "")
104
+ BVM_SRC_VERSION="v${BVM_LATEST:-$DEFAULT_BVM_VERSION}"
204
105
  fi
106
+ echo -e "${GREEN}${BVM_SRC_VERSION}${RESET}"
205
107
 
206
- # Calculate Major version for Bun runtime
207
- BVM_PLAIN_VER="${BVM_SRC_VERSION#v}"
208
- BUN_MAJOR="${BVM_PLAIN_VER%%.*}"
209
-
210
- # Resolve latest Bun matching that major version
211
- if [ -n "$BVM_INSTALL_BUN_VERSION" ]; then
212
- BUN_VER="$BVM_INSTALL_BUN_VERSION"
213
- else
214
- BUN_LATEST=$(curl -s https://${REGISTRY}/-/package/bun/dist-tags | grep -oE '"latest":"[^"]+"' | cut -d'"' -f4 || echo "")
215
- if [[ "$BUN_LATEST" == "$BUN_MAJOR."* ]]; then
216
- BUN_VER="$BUN_LATEST"
217
- else
218
- # Emergency fallback
219
- BUN_VER="$FALLBACK_BUN_VERSION"
220
- fi
221
- fi
222
-
223
- echo -e "${GREEN}${BVM_SRC_VERSION} (Bun v${BUN_VER})${RESET}"
224
-
225
- # 2. Setup Directories
226
- mkdir -p "$BVM_DIR" "$BVM_SRC_DIR" "$BVM_RUNTIME_DIR" "$BVM_BIN_DIR" "$BVM_SHIMS_DIR" "$BVM_ALIAS_DIR"
227
-
228
- # 3. Download Runtime (if needed)
229
- TARGET_RUNTIME_DIR="${BVM_RUNTIME_DIR}/v${BUN_VER}"
230
- if [ -d "${TARGET_RUNTIME_DIR}/bin" ] && [ -x "${TARGET_RUNTIME_DIR}/bin/bun" ]; then
231
- success "Runtime (bun@${BUN_VER}) already installed."
232
- else
233
- OS="$(uname -s | tr -d '"')"
234
- ARCH="$(uname -m | tr -d '"')"
235
- case "$OS" in
236
- Linux) P="linux" ;;
237
- Darwin) P="darwin" ;;
238
- MINGW*|MSYS*|CYGWIN*) P="windows" ;;
239
- *) error "Unsupported OS: $OS" ;;
240
- esac
241
- case "$ARCH" in
242
- x86_64) A="x64" ;;
243
- arm64|aarch64) A="aarch64" ;;
244
- *) error "Unsupported Arch: $ARCH" ;;
245
- esac
246
-
247
- if [ "$P" == "darwin" ]; then
248
- PKG="@oven/bun-darwin-$A"
249
- EXE="bun"
250
- elif [ "$P" == "windows" ]; then
251
- PKG="@oven/bun-windows-$A"
252
- EXE="bun.exe"
253
- else
254
- PKG="@oven/bun-linux-$A"
255
- EXE="bun"
256
- fi
257
-
258
- URL="https://${REGISTRY}/${PKG}/-/${PKG##*/}-${BUN_VER}.tgz"
259
-
260
- TEMP_DIR="$(mktemp -d)"
261
- TEMP_TGZ="${TEMP_DIR}/bun-runtime.tgz"
262
-
263
- download_file "$URL" "$TEMP_TGZ" "Downloading Runtime (bun@${BUN_VER})..."
264
-
265
- # Check if download succeeded
266
- if [ ! -f "$TEMP_TGZ" ] || [ ! -s "$TEMP_TGZ" ]; then
267
- error "Download failed or empty file."
268
- fi
108
+ # 3. Setup Directories
109
+ mkdir -p "$BVM_DIR" "$BVM_SRC_DIR" "$BVM_RUNTIME_DIR" "$BVM_BIN_DIR" "$BVM_SHIMS_DIR" "$BVM_ALIAS_DIR" "$BVM_VERSIONS_DIR"
269
110
 
270
- # Extract
271
- tar -xzf "$TEMP_TGZ" -C "$TEMP_DIR"
272
-
273
- # Move
274
- mkdir -p "${TARGET_RUNTIME_DIR}/bin"
275
- FOUND_BIN="$(find "$TEMP_DIR" -type f -name "$EXE" | head -n 1)"
276
- if [ -z "$FOUND_BIN" ]; then
277
- error "Could not find '$EXE' binary in downloaded archive."
278
- fi
279
-
280
- mv "$FOUND_BIN" "${TARGET_RUNTIME_DIR}/bin/bun"
281
- chmod +x "${TARGET_RUNTIME_DIR}/bin/bun"
282
- success "Runtime installed."
283
- fi
284
-
285
- # Link current runtime
286
- rm -rf "${BVM_RUNTIME_DIR}/current"
287
- ln -sf "$TARGET_RUNTIME_DIR" "${BVM_RUNTIME_DIR}/current"
288
-
289
- # 4. Download BVM Source & Shim (Tarball Strategy)
290
- # Use Registry Tarball to avoid CDN sync delays
111
+ # 4. Download BVM Source (Needed for Smoke Test)
291
112
  if [ "$BVM_REGION" == "cn" ]; then
292
113
  TARBALL_URL="https://registry.npmmirror.com/bvm-core/-/bvm-core-${BVM_SRC_VERSION#v}.tgz"
293
114
  else
294
115
  TARBALL_URL="https://registry.npmjs.org/bvm-core/-/bvm-core-${BVM_SRC_VERSION#v}.tgz"
295
116
  fi
296
117
 
297
- # Local fallback for development/testing
298
118
  if [ -f "./dist/index.js" ]; then
299
119
  cp "./dist/index.js" "${BVM_SRC_DIR}/index.js"
300
120
  cp "./dist/bvm-shim.sh" "${BVM_BIN_DIR}/bvm-shim.sh"
301
- info "Using local BVM source from dist/."
302
121
  else
303
- TEMP_TGZ="$(mktemp)"
122
+ TEMP_TGZ=$(mktemp)
304
123
  download_file "$TARBALL_URL" "$TEMP_TGZ" "Downloading BVM Source (${BVM_SRC_VERSION})..."
305
-
306
- # Extract specific files from tarball (strip components to handle 'package/' prefix)
307
- # The tarball structure is package/dist/index.js
308
124
  tar -xzf "$TEMP_TGZ" -C "$BVM_SRC_DIR" --strip-components=2 "package/dist/index.js"
309
125
  tar -xzf "$TEMP_TGZ" -C "$BVM_BIN_DIR" --strip-components=2 "package/dist/bvm-shim.sh"
310
-
311
126
  rm -f "$TEMP_TGZ"
312
127
  fi
128
+ chmod +x "${BVM_BIN_DIR}/bvm-shim.sh"
313
129
 
314
- if [ ! -f "${BVM_SRC_DIR}/index.js" ] || [ ! -f "${BVM_BIN_DIR}/bvm-shim.sh" ]; then
315
- error "Failed to extract BVM source or shim from tarball."
130
+ # 5. Detect System Bun & Runtime Selection
131
+ SYSTEM_BUN_BIN=$(command -v bun || echo "")
132
+ SYSTEM_BUN_VER=""
133
+ [ -n "$SYSTEM_BUN_BIN" ] && SYSTEM_BUN_VER=$(bun --version | sed 's/^v//')
134
+
135
+ USE_SYSTEM_AS_RUNTIME=false
136
+ BUN_VER=""
137
+
138
+ if [ -n "$SYSTEM_BUN_BIN" ]; then
139
+ info "Found system Bun v${SYSTEM_BUN_VER} at ${SYSTEM_BUN_BIN}"
140
+ # Register system bun in versions
141
+ SYS_VER_DIR="${BVM_VERSIONS_DIR}/v${SYSTEM_BUN_VER}"
142
+ mkdir -p "${SYS_VER_DIR}/bin"
143
+ cp "$SYSTEM_BUN_BIN" "${SYS_VER_DIR}/bin/bun"
144
+ chmod +x "${SYS_VER_DIR}/bin/bun"
145
+
146
+ # Smoke Test
147
+ if "$SYSTEM_BUN_BIN" "${BVM_SRC_DIR}/index.js" --version >/dev/null 2>&1; then
148
+ success "Smoke Test passed: System Bun is compatible."
149
+ USE_SYSTEM_AS_RUNTIME=true
150
+ BUN_VER="v${SYSTEM_BUN_VER}"
151
+ else
152
+ warn "Smoke Test failed: System Bun cannot run BVM core."
153
+ fi
316
154
  fi
317
- chmod +x "${BVM_BIN_DIR}/bvm-shim.sh"
318
155
 
319
- # 5. Create Shims (Decoupled from index.js)
320
- echo -n -e "${BLUE}ℹ${RESET} Initializing shims... "
156
+ if [ "$USE_SYSTEM_AS_RUNTIME" = true ]; then
157
+ TARGET_RUNTIME_DIR="${BVM_VERSIONS_DIR}/${BUN_VER}"
158
+ else
159
+ # Resolve and download compatible runtime
160
+ BUN_LATEST=$(curl -s https://${REGISTRY}/-/package/bun/dist-tags | grep -oE '"latest":"[^" ]+"' | cut -d'"' -f4 || echo "$FALLBACK_BUN_VERSION")
161
+ BUN_VER="v${BUN_LATEST}"
162
+ TARGET_RUNTIME_DIR="${BVM_VERSIONS_DIR}/${BUN_VER}"
163
+
164
+ if [ ! -x "${TARGET_RUNTIME_DIR}/bin/bun" ]; then
165
+ OS="$(uname -s | tr -d '"')"
166
+ ARCH="$(uname -m | tr -d '"')"
167
+ case "$OS" in Linux) P="linux" ;; Darwin) P="darwin" ;; *) error "Unsupported OS: $OS" ;; esac
168
+ case "$ARCH" in x86_64) A="x64" ;; arm64|aarch64) A="aarch64" ;; *) error "Unsupported Arch: $ARCH" ;; esac
169
+ PKG="@oven/bun-$P-$A"
170
+ URL="https://${REGISTRY}/${PKG}/-/${PKG##*/}-${BUN_VER#v}.tgz"
171
+
172
+ TEMP_DIR_BUN=$(mktemp -d)
173
+ TEMP_TGZ_BUN="${TEMP_DIR_BUN}/bun-runtime.tgz"
174
+ download_file "$URL" "$TEMP_TGZ_BUN" "Downloading Compatible Runtime (bun@${BUN_VER#v})..."
175
+ tar -xzf "$TEMP_TGZ_BUN" -C "$TEMP_DIR_BUN"
176
+ mkdir -p "${TARGET_RUNTIME_DIR}/bin"
177
+ mv "$(find "$TEMP_DIR_BUN" -type f -name "bun" | head -n 1)" "${TARGET_RUNTIME_DIR}/bin/bun"
178
+ chmod +x "${TARGET_RUNTIME_DIR}/bin/bun"
179
+ rm -rf "$TEMP_DIR_BUN"
180
+ fi
181
+ fi
182
+
183
+ # 6. Configure Runtime & Aliases
184
+ rm -rf "${BVM_RUNTIME_DIR}/current"
185
+ ln -sf "$TARGET_RUNTIME_DIR" "${BVM_RUNTIME_DIR}/current"
321
186
 
322
- # Create bvm wrapper
187
+ # Also link to ~/.bvm/current for user/shims compatibility
188
+ rm -rf "${BVM_DIR}/current"
189
+ ln -sf "$TARGET_RUNTIME_DIR" "${BVM_DIR}/current"
190
+
191
+ echo "$BUN_VER" > "${BVM_ALIAS_DIR}/default"
192
+
193
+ # 7. Create Shims & Wrappers
194
+ info "Initializing shims..."
323
195
  cat > "${BVM_BIN_DIR}/bvm" <<EOF
324
196
  #!/bin/bash
325
197
  export BVM_DIR="$BVM_DIR"
@@ -327,7 +199,6 @@ exec "${BVM_RUNTIME_DIR}/current/bin/bun" "$BVM_SRC_DIR/index.js" "\$@"
327
199
  EOF
328
200
  chmod +x "${BVM_BIN_DIR}/bvm"
329
201
 
330
- # Create bun and bunx shims
331
202
  for cmd in bun bunx; do
332
203
  cat > "${BVM_SHIMS_DIR}/${cmd}" <<EOF
333
204
  #!/bin/bash
@@ -336,68 +207,20 @@ exec "${BVM_BIN_DIR}/bvm-shim.sh" "$cmd" "\$@"
336
207
  EOF
337
208
  chmod +x "${BVM_SHIMS_DIR}/${cmd}"
338
209
  done
210
+ success "Shims initialized."
339
211
 
340
- echo -e "${GREEN}Done${RESET}"
341
-
342
- # 6. Initialize First Version
343
- if [ ! -f "${BVM_ALIAS_DIR}/default" ]; then
344
- # Create the versions entry for the first download
345
- mkdir -p "${BVM_DIR}/versions/v${BUN_VER}/bin"
346
- ln -sf "${TARGET_RUNTIME_DIR}/bin/bun" "${BVM_DIR}/versions/v${BUN_VER}/bin/bun"
347
- # Set it as default
348
- echo "v${BUN_VER}" > "${BVM_ALIAS_DIR}/default"
349
- fi
350
-
351
- # We no longer need to run '$WRAPPER rehash' because we just did it manually/statically
352
- SETUP_SUCCESS=true
212
+ # 8. Setup Environment
353
213
  if ! "${BVM_BIN_DIR}/bvm" setup --silent >/dev/null 2>&1; then
354
- SETUP_SUCCESS=false
214
+ warn "Environment setup failed. You may need to manually add BVM to your PATH."
355
215
  fi
356
216
 
357
- # 7. Final Instructions
358
- echo ""
359
- echo -e "${GREEN}${BOLD}🎉 BVM Installed Successfully!${RESET}"
360
- echo ""
361
-
217
+ # 9. Final Instructions
218
+ success "${BOLD}🎉 BVM Installed Successfully!${RESET}"
362
219
  CURRENT_SHELL=$(detect_shell)
363
- DISPLAY_PROFILE=""
364
-
365
220
  case "$CURRENT_SHELL" in
366
- zsh) DISPLAY_PROFILE="$HOME/.zshrc" ;;
367
- bash)
368
- # Prefer .bashrc if it exists (common for users who manually set up their environment)
369
- if [ -f "$HOME/.bashrc" ]; then
370
- DISPLAY_PROFILE="$HOME/.bashrc"
371
- elif [ -f "$HOME/.bash_profile" ]; then
372
- DISPLAY_PROFILE="$HOME/.bash_profile"
373
- else
374
- DISPLAY_PROFILE="$HOME/.bashrc"
375
- fi
376
- ;;
377
- fish) DISPLAY_PROFILE="$HOME/.config/fish/config.fish" ;;
378
- *) DISPLAY_PROFILE="$HOME/.profile" ;;
221
+ zsh) DP="$HOME/.zshrc" ;;
222
+ bash) DP="$([ -f "$HOME/.bashrc" ] && echo "$HOME/.bashrc" || echo "$HOME/.bash_profile")" ;;
223
+ fish) DP="$HOME/.config/fish/config.fish" ;;
224
+ *) DP="$HOME/.profile" ;;
379
225
  esac
380
-
381
- echo "To start using bvm:"
382
- echo ""
383
-
384
- if [ "$SETUP_SUCCESS" = true ]; then
385
- # If setup succeeded, we don't need to show the long echo command
386
- echo -e " ${YELLOW}1. Refresh your shell:${RESET}"
387
- echo " source $DISPLAY_PROFILE"
388
-
389
- echo ""
390
- echo -e " ${YELLOW}2. Verify:${RESET}"
391
- echo -e " bvm --version"
392
- else
393
- # If setup failed for some reason, we fallback to manual instructions
394
- echo -e " ${YELLOW}1. Add to config:${RESET}"
395
- echo " echo 'export PATH=\"\$HOME/.bvm/bin:\$PATH\"' >> $DISPLAY_PROFILE"
396
- echo ""
397
- echo -e " ${YELLOW}2. Refresh your shell:${RESET}"
398
- echo " source $DISPLAY_PROFILE"
399
-
400
- echo ""
401
- echo -e " ${YELLOW}3. Verify:${RESET}"
402
- echo -e " bvm --version"
403
- fi
226
+ echo -e "\nTo start using bvm:\n ${YELLOW}1. Refresh your shell:${RESET}\n source $DP\n\n ${YELLOW}2. Verify:${RESET}\n bvm --version"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bvm-core",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "The native version manager for Bun. Cross-platform, shell-agnostic, and zero-dependency.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -56,7 +56,7 @@
56
56
  "@types/bun": "^1.3.4",
57
57
  "@types/cli-progress": "^3.11.6",
58
58
  "@types/node": "^24.10.2",
59
- "bun": "^1.3.5",
59
+ "bun": "^1.3.6",
60
60
  "esbuild": "^0.27.2",
61
61
  "execa": "^9.6.1",
62
62
  "typescript": "^5"
@@ -65,10 +65,10 @@
65
65
  "typescript": "^5"
66
66
  },
67
67
  "bvm_fingerprints": {
68
- "cli": "9dd60ac29abd52da8492dad42a05d098",
68
+ "cli": "aeb723ece3c90ec011a97117fd7d2758",
69
69
  "shim_win": "c6f43afddfb205e130633fe00ee860d8",
70
70
  "shim_unix": "8aa89a0324b52c9c81b96c0c03afe36c",
71
- "install_sh": "4cbbeb392a1c3ba12d3992cc72cce22c",
72
- "install_ps1": "1892c9cdb19aad5a4b23f656395d3679"
71
+ "install_sh": "ffee66f37a34913792a0ae88906047f9",
72
+ "install_ps1": "f448275dd566c527700d3a2ce928e3d5"
73
73
  }
74
74
  }