From 2ea07ea17da8444414a6cbf993104d01176b1583 Mon Sep 17 00:00:00 2001 From: Alberto De Bortoli Date: Fri, 27 Mar 2026 16:18:26 +0000 Subject: [PATCH] Handle both 'Luca' and 'luca' binary names in install and uninstall scripts The Linux zip may extract the binary as either 'luca' (lowercase) or 'Luca' (uppercase) depending on the release. On case-sensitive Linux filesystems this caused the mv to fail. Both scripts now detect whichever name is present. --- install.sh | 11 ++++++++++- uninstall.sh | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 1acccf4..5c3ced2 100755 --- a/install.sh +++ b/install.sh @@ -235,8 +235,17 @@ if [ ! -d "$INSTALL_DIR" ]; then fi # Move the executable to the install directory and make it executable +# The zip may contain either 'Luca' (uppercase) or 'luca' (lowercase) depending on the release echo "🚀 Installing $TOOL_NAME to $INSTALL_DIR..." -sudo_if_install_dir_not_writeable "mv $TOOL_NAME $EXECUTABLE_FILE" +if [ -f "$TOOL_NAME" ]; then + EXTRACTED_BIN="$TOOL_NAME" +elif [ -f "$BIN_NAME" ]; then + EXTRACTED_BIN="$BIN_NAME" +else + echo "❌ ERROR: Could not find extracted binary (expected '$TOOL_NAME' or '$BIN_NAME')" + exit 1 +fi +sudo_if_install_dir_not_writeable "mv $EXTRACTED_BIN $EXECUTABLE_FILE" sudo_if_install_dir_not_writeable "chmod +x $EXECUTABLE_FILE" echo "✅ $TOOL_NAME ($REQUIRED_EXECUTABLE_VERSION) successfully installed to $INSTALL_DIR" diff --git a/uninstall.sh b/uninstall.sh index b283c45..7a3fa39 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -8,11 +8,19 @@ # ============================================================================= TOOL_NAME="Luca" +BIN_NAME="luca" INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}" TOOL_FOLDER=".luca" TOOL_DIR="$HOME/$TOOL_FOLDER" SHELL_HOOK_SCRIPT_PATH="$TOOL_DIR/shell_hook.sh" -EXECUTABLE_FILE="$INSTALL_DIR/$TOOL_NAME" +# The binary may be installed as 'luca' (lowercase) or 'Luca' (uppercase) depending on the version +if [ -f "$INSTALL_DIR/$BIN_NAME" ]; then + EXECUTABLE_FILE="$INSTALL_DIR/$BIN_NAME" +elif [ -f "$INSTALL_DIR/$TOOL_NAME" ]; then + EXECUTABLE_FILE="$INSTALL_DIR/$TOOL_NAME" +else + EXECUTABLE_FILE="$INSTALL_DIR/$BIN_NAME" +fi # ============================================================================= # TERMINAL COLORS