From 4d8f029c8f9176aa9df04d379868c6e6b86d2b73 Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Mon, 26 Jan 2026 01:02:46 -0800 Subject: [PATCH] fix: Install script now uses release tag instead of main branch (#75) Problem: Even though the website fetched install.sh from a specific release tag, the script itself would clone the repository from main branch, installing potentially unstable/untested code. Solution: - Add --tag parameter to install.sh to specify which release to install - Default to v0.3.0-alpha (latest stable) instead of main - Clone the specific tag using 'git clone --branch ' - Update website to pass --tag parameter with fetched release Changes: - install.sh: Add --tag parameter, default to v0.3.0-alpha, clone specific tag - web/src/app/page.tsx: Pass --tag= to install script This ensures users install the exact release version they intended, not whatever code is currently on main branch. Co-authored-by: Claude Opus --- install.sh | 16 ++++++++++++---- web/src/app/page.tsx | 8 ++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index d4df962..5ec3d99 100755 --- a/install.sh +++ b/install.sh @@ -70,6 +70,10 @@ while [[ $# -gt 0 ]]; do NON_INTERACTIVE="yes" # Skip the prompt shift ;; + --tag=*) + INSTALL_TAG="${1#*=}" + shift + ;; -y|--yes) NON_INTERACTIVE="yes" shift @@ -85,6 +89,7 @@ while [[ $# -gt 0 ]]; do echo " --with-whisper Install Whisper AI support with GPU/CUDA (included by default)" echo " --whisper-cpu Install Whisper with CPU-only PyTorch (smaller download, works on low-RAM)" echo " --no-whisper VOSK-only install (skips Whisper entirely, uses VOSK as default)" + echo " --tag=TAG Install specific release tag (default: v0.3.0-alpha)" echo " -y, --yes Non-interactive mode (accept defaults)" echo " --help Show this help message" exit 0 @@ -106,6 +111,9 @@ print_info "Vocalinux Installer" print_info "==============================" echo "" +# Default to installing from latest stable release instead of main branch +INSTALL_TAG="${INSTALL_TAG:-v0.3.0-alpha}" + # Check if running from within the vocalinux repo or remotely (via curl) REPO_URL="https://github.com/jatinkrmalik/vocalinux.git" INSTALL_DIR="" @@ -117,18 +125,18 @@ if [ -f "setup.py" ] || [ -f "pyproject.toml" ]; then print_info "Running from local repository: $INSTALL_DIR" else # Running remotely (e.g., via curl | bash) - print_info "Cloning Vocalinux repository..." + print_info "Installing Vocalinux version: ${INSTALL_TAG}" INSTALL_DIR="$HOME/.local/share/vocalinux-install" mkdir -p "$INSTALL_DIR" if [ -d "$INSTALL_DIR/.git" ]; then print_info "Updating existing clone..." cd "$INSTALL_DIR" - git fetch origin main - git reset --hard origin/main + git fetch origin "$INSTALL_TAG" + git reset --hard "origin/$INSTALL_TAG" else rm -rf "$INSTALL_DIR" - git clone --depth 1 "$REPO_URL" "$INSTALL_DIR" || { + git clone --depth 1 --branch "$INSTALL_TAG" "$REPO_URL" "$INSTALL_DIR" || { print_error "Failed to clone Vocalinux repository" exit 1 } diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx index e5edb7d..7bb37e9 100644 --- a/web/src/app/page.tsx +++ b/web/src/app/page.tsx @@ -39,19 +39,19 @@ import { atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs"; import { useInView } from "react-intersection-observer"; // The one-liner install command (split into three lines for display) -// Uses the latest stable release tag instead of main branch +// Uses the latest stable release tag and passes it to the script const getInstallCommands = (latestRelease: string) => ({ oneClickInstallCommand: `curl \\ -fsSL https://raw.githubusercontent.com/jatinkrmalik/vocalinux/${latestRelease}/install.sh \\ - | bash`, + | bash -s -- --tag=${latestRelease}`, oneClickInstallWhisperCpu: `curl \\ -fsSL https://raw.githubusercontent.com/jatinkrmalik/vocalinux/${latestRelease}/install.sh \\ - | bash -s -- --whisper-cpu`, + | bash -s -- --tag=${latestRelease} --whisper-cpu`, oneClickInstallNoWhisper: `curl \\ -fsSL https://raw.githubusercontent.com/jatinkrmalik/vocalinux/${latestRelease}/install.sh \\ - | bash -s -- --no-whisper`, + | bash -s -- --tag=${latestRelease} --no-whisper`, uninstallCommand: `curl -fsSL \\ https://raw.githubusercontent.com/jatinkrmalik/vocalinux/${latestRelease}/uninstall.sh \\