Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ curl -fsSL https://raw.githubusercontent.com/coder/boundary/main/install.sh | ba
**Custom Installation Options**
```bash
# Install specific version
curl -fsSL https://raw.githubusercontent.com/coder/boundary/main/install.sh | bash -s -- --version 1.0.0
curl -fsSL https://raw.githubusercontent.com/coder/boundary/main/install.sh | bash -s -- --version v1.0.0

# Install to custom directory
curl -fsSL https://raw.githubusercontent.com/coder/boundary/main/install.sh | bash -s -- --install-dir ~/.local/bin
Expand Down
17 changes: 9 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,16 @@ get_latest_version() {
log_error "Failed to fetch the latest release version. Please check your internet connection."
fi

# Remove 'v' prefix if present
VERSION=${VERSION#v}

log_info "Latest version: $VERSION"
}

# Download binary
download_binary() {
local binary_name="${BINARY_NAME}-${PLATFORM}"
local download_url="https://github.com/$REPO/releases/download/v$VERSION/${binary_name}.tar.gz"
local download_url="https://github.com/$REPO/releases/download/$VERSION/${binary_name}.tar.gz"
local archive_path="$TMP_DIR/${binary_name}.tar.gz"

log_info "Downloading $binary_name v$VERSION..."
log_info "Downloading $binary_name $VERSION..."
log_info "URL: $download_url"

if command -v curl &> /dev/null; then
Expand Down Expand Up @@ -303,7 +300,7 @@ main() {
VERSION="$2"
shift 2
else
log_error "--version requires a version number"
log_error "--version requires a version number (use 'latest' to get the latest version)"
fi
;;
--install-dir)
Expand All @@ -320,7 +317,7 @@ main() {
echo "Usage: $0 [OPTIONS]"
echo
echo "Options:"
echo " --version VERSION Install specific version (default: latest)"
echo " --version VERSION Install specific version or 'latest' (default: latest)"
echo " --install-dir DIR Install directory (default: /usr/local/bin)"
echo " -h, --help Show this help message"
echo
Expand All @@ -329,6 +326,7 @@ main() {
echo
echo "Examples:"
echo " $0 # Install latest version"
echo " $0 --version latest # Explicitly install latest version"
echo " $0 --version 1.0.0 # Install specific version"
echo " $0 --install-dir ~/.local/bin # Install to custom directory"
echo " INSTALL_DIR=~/.local/bin $0 # Using environment variable"
Expand All @@ -344,9 +342,12 @@ main() {
detect_platform
check_permissions

# Get version if not specified
# Get version if not specified or if "latest" was explicitly requested
if [[ -z "$VERSION" ]]; then
get_latest_version
elif [[ "$VERSION" == "latest" ]]; then
log_info "Fetching latest version..."
get_latest_version
else
log_info "Using specified version: $VERSION"
fi
Expand Down
Loading