From 7768df55a6f21bec5eff20d9448d8b0ef2d1a85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Tue, 31 Dec 2024 17:57:23 +0100 Subject: [PATCH] install-script: remove filename extension before installing. --- install-script | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install-script b/install-script index f3e24f9..0eb61dc 100755 --- a/install-script +++ b/install-script @@ -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"