1
0

fixes script locations on bash and zsh

This commit is contained in:
2024-12-01 12:07:23 +01:00
parent 4953a8d9cc
commit 7b5ae9b402
+6 -1
View File
@@ -5,7 +5,12 @@
# Source this script in your rc:
# source /path/to/here/install.sh
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
# Get script directory for both bash and zsh
if [ -n "$BASH_SOURCE" ]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
else
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
fi
BIN_DIR="$SCRIPT_DIR/bin"
ENV_FILE="$SCRIPT_DIR/.env"