From 08a8e2d39e6d54b5d2a7703b983aa4ae1b888cd6 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 20 Mar 2026 20:57:21 +0000 Subject: [PATCH] fix(install): default to ~/.local/bin for unprivileged installs Change the default INSTALL_DIR from /usr/local/bin to $HOME/.local/bin so the script works without sudo. Also move mkdir -p before the privilege check so a non-existent directory doesn't fail the writability test. Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index cdd74e2..3724974 100644 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ set -e # curl -fsSL https://raw.githubusercontent.com/mrmaxsteel/mindspec/main/install.sh | sh -s -- --force REPO="mrmaxsteel/mindspec" -INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}" +INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}" BINARY_NAME="mindspec" FORCE_INSTALL="${FORCE_INSTALL:-false}" LOG_FILE="${HOME}/.mindspec/install.log" @@ -258,17 +258,19 @@ Got: $ACTUAL_CHECKSUM" info "Extracting..." tar -xzf "$TMP_DIR/$ARCHIVE_NAME" -C "$TMP_DIR" + # Ensure install directory exists before privilege check + mkdir -p "$INSTALL_DIR" + # Check privileges before attempting install if ! check_privileges; then error "Cannot write to $INSTALL_DIR" fi - + # Check for existing installation check_existing_installation - + # Install binary info "Installing to ${INSTALL_DIR}/${BINARY_NAME}..." - mkdir -p "$INSTALL_DIR" mv "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" chmod +x "$INSTALL_DIR/$BINARY_NAME"