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:
14
setup.sh
14
setup.sh
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user