Use a ZSH-compatible version of BASH_SOURCE[0]
This commit is contained in:
@@ -6,7 +6,9 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
# If BASH_SOURCE is undefined, we may be running under zsh, in that case
|
||||||
|
# provide a zsh-compatible alternative
|
||||||
|
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]:-${(%):-%x}}")")"
|
||||||
CHIPYARD_DIR="$(dirname "$DIR")"
|
CHIPYARD_DIR="$(dirname "$DIR")"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ if [ "$MINGIT" != "$(echo -e "$MINGIT\n$MYGIT" | sort -V | head -n1)" ]; then
|
|||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
# If BASH_SOURCE is undefined we may be running under zsh, in that case
|
||||||
|
# provide a zsh-compatible alternative
|
||||||
|
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]:-${(%):-%x}}")")"
|
||||||
CHIPYARD_DIR="$(dirname "$DIR")"
|
CHIPYARD_DIR="$(dirname "$DIR")"
|
||||||
|
|
||||||
cd "$CHIPYARD_DIR"
|
cd "$CHIPYARD_DIR"
|
||||||
|
|||||||
Reference in New Issue
Block a user