Skip to content

Commit 71a6bc6

Browse files
committed
fix: prevent log messages from contaminating version string in install script
- Move 'Fetching latest release information...' log outside get_latest_version function - Redirect error messages to stderr to avoid capture in subshell assignments - Fixes malformed download URLs when VERSION contains log text
1 parent ba1525e commit 71a6bc6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/cli/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ detect_arch() {
5656
# Function to get the latest release version
5757
get_latest_version() {
5858
local repo=$1
59-
log_info "Fetching latest release information..."
6059

6160
# Try to get the latest release tag from GitHub API
6261
if command -v curl >/dev/null 2>&1; then
@@ -68,7 +67,7 @@ get_latest_version() {
6867
grep '"tag_name":' | \
6968
sed -E 's/.*"([^"]+)".*/\1/'
7069
else
71-
log_error "Neither curl nor wget is available. Please install one of them."
70+
log_error "Neither curl nor wget is available. Please install one of them." >&2
7271
exit 1
7372
fi
7473
}
@@ -333,6 +332,7 @@ main() {
333332

334333
# Get version
335334
if [ -z "$VERSION" ]; then
335+
log_info "Fetching latest release information..."
336336
VERSION=$(get_latest_version "$GITHUB_REPO")
337337
if [ -z "$VERSION" ]; then
338338
log_error "Failed to fetch latest version. Please specify a version manually."

0 commit comments

Comments
 (0)