install-script: remove filename extension before installing.

This commit is contained in:
Nicolás A. Ortega Froysa 2024-12-31 17:57:23 +01:00
parent 0f439be1f9
commit 7768df55a6

View File

@ -2,4 +2,12 @@
set -euo pipefail
install -m 755 "$1" "$HOME/.local/bin"
SCRIPT_FILE="$1"
# Remove extension from script
if [[ $SCRIPT_FILE == *.* ]]
then
SCRIPT_FILE=${SCRIPT_FILE%.*}
fi
install -m 755 "$SCRIPT_FILE" "$HOME/.local/bin"