chore: fix just installation by using versioned release URLs

The previous implementation used `/latest/download/` which doesn't work with just's release naming convention. Now fetches the latest version tag from GitHub API and constructs the correct versioned download URL.
This commit is contained in:
Jose B
2025-12-04 13:45:34 -05:00
parent 177d0d9f64
commit 58444fd37f

View File

@@ -222,8 +222,18 @@ install_just() {
;; ;;
esac esac
local binary_name="just-${arch}-${os}" # Get latest version from GitHub API
local download_url="https://github.com/casey/just/releases/latest/download/${binary_name}.tar.gz" log_info "Fetching latest version..."
local latest_version=$(curl -fsSL https://api.github.com/repos/casey/just/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$latest_version" ]; then
log_error "Failed to fetch latest version"
log_info "Please install just manually: https://github.com/casey/just#installation"
exit 1
fi
local binary_name="just-${latest_version}-${arch}-${os}"
local download_url="https://github.com/casey/just/releases/download/${latest_version}/${binary_name}.tar.gz"
local install_dir="$HOME/.local/bin" local install_dir="$HOME/.local/bin"
# Create install directory # Create install directory