diff --git a/README.md b/README.md index 90ad445..10a587f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This script will: - Detect your OS and architecture automatically - Download the appropriate prebuilt binary - Verify the checksum for security -- Install to `~/.local/bin` (or use `INSTALL_DIR` to customize) +- Install to `/usr/local/bin` on macOS/Linux or `~/.local/bin` on Windows (or use `INSTALL_DIR` to customize) - Make the binary executable **Custom installation directory:** diff --git a/install.sh b/install.sh index f92e234..d56d1b7 100755 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ NC='\033[0m' # No Color # Configuration REPO="hdresearch/vers-cli" -INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}" +INSTALL_DIR="${INSTALL_DIR:-}" GITHUB_API="https://api.github.com/repos/${REPO}/releases/latest" # Helper functions @@ -118,6 +118,15 @@ main() { ARCH=$(detect_arch) info "Detected OS: $OS, Architecture: $ARCH" + # Use a PATH location by default on macOS/Linux while preserving the + # existing Windows install location. An explicit INSTALL_DIR takes priority. + if [ -z "$INSTALL_DIR" ]; then + case "$OS" in + linux|darwin) INSTALL_DIR="/usr/local/bin" ;; + windows) INSTALL_DIR="$HOME/.local/bin" ;; + esac + fi + # Get version VERSION="${VERS_VERSION:-$(get_latest_version)}" info "Installing version: $VERSION"