Skip to content

Commit 4142de5

Browse files
Merge pull request #10 from LucaTools/allow-for-casing-differences
Handle both 'Luca' and 'luca' binary names for case-sensitive filesystems
2 parents 54ee614 + 2ea07ea commit 4142de5

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

install.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,17 @@ if [ ! -d "$INSTALL_DIR" ]; then
235235
fi
236236

237237
# Move the executable to the install directory and make it executable
238+
# The zip may contain either 'Luca' (uppercase) or 'luca' (lowercase) depending on the release
238239
echo "🚀 Installing $TOOL_NAME to $INSTALL_DIR..."
239-
sudo_if_install_dir_not_writeable "mv $TOOL_NAME $EXECUTABLE_FILE"
240+
if [ -f "$TOOL_NAME" ]; then
241+
EXTRACTED_BIN="$TOOL_NAME"
242+
elif [ -f "$BIN_NAME" ]; then
243+
EXTRACTED_BIN="$BIN_NAME"
244+
else
245+
echo "❌ ERROR: Could not find extracted binary (expected '$TOOL_NAME' or '$BIN_NAME')"
246+
exit 1
247+
fi
248+
sudo_if_install_dir_not_writeable "mv $EXTRACTED_BIN $EXECUTABLE_FILE"
240249
sudo_if_install_dir_not_writeable "chmod +x $EXECUTABLE_FILE"
241250

242251
echo "$TOOL_NAME ($REQUIRED_EXECUTABLE_VERSION) successfully installed to $INSTALL_DIR"

uninstall.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@
88
# =============================================================================
99

1010
TOOL_NAME="Luca"
11+
BIN_NAME="luca"
1112
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
1213
TOOL_FOLDER=".luca"
1314
TOOL_DIR="$HOME/$TOOL_FOLDER"
1415
SHELL_HOOK_SCRIPT_PATH="$TOOL_DIR/shell_hook.sh"
15-
EXECUTABLE_FILE="$INSTALL_DIR/$TOOL_NAME"
16+
# The binary may be installed as 'luca' (lowercase) or 'Luca' (uppercase) depending on the version
17+
if [ -f "$INSTALL_DIR/$BIN_NAME" ]; then
18+
EXECUTABLE_FILE="$INSTALL_DIR/$BIN_NAME"
19+
elif [ -f "$INSTALL_DIR/$TOOL_NAME" ]; then
20+
EXECUTABLE_FILE="$INSTALL_DIR/$TOOL_NAME"
21+
else
22+
EXECUTABLE_FILE="$INSTALL_DIR/$BIN_NAME"
23+
fi
1624

1725
# =============================================================================
1826
# TERMINAL COLORS

0 commit comments

Comments
 (0)