fixes script locations on bash and zsh
This commit is contained in:
+6
-1
@@ -5,7 +5,12 @@
|
|||||||
# Source this script in your rc:
|
# Source this script in your rc:
|
||||||
# source /path/to/here/install.sh
|
# 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"
|
BIN_DIR="$SCRIPT_DIR/bin"
|
||||||
ENV_FILE="$SCRIPT_DIR/.env"
|
ENV_FILE="$SCRIPT_DIR/.env"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user