aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2016-01-16 13:56:50 -0500
committerTim Harder <radhermit@gmail.com>2016-01-16 13:56:50 -0500
commit2f5e9232fbf3ccd18354198ae57b695b40213f88 (patch)
treeb800bcbaae2074c26351ffa321933ac754e197cf /shell
parentesite: drop subshell for browser call (diff)
downloadpkgcore-2f5e9232fbf3ccd18354198ae57b695b40213f88.tar.gz
pkgcore-2f5e9232fbf3ccd18354198ae57b695b40213f88.tar.bz2
pkgcore-2f5e9232fbf3ccd18354198ae57b695b40213f88.zip
shell: fix getting the current script path for both bash/zsh
Diffstat (limited to 'shell')
-rw-r--r--shell/pkgcore.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/shell/pkgcore.sh b/shell/pkgcore.sh
index ed3a10a0..0dfd7615 100644
--- a/shell/pkgcore.sh
+++ b/shell/pkgcore.sh
@@ -9,7 +9,13 @@ if [[ ${PKGSHELL} != "bash" && ${PKGSHELL} != "zsh" ]]; then
echo "$(basename ${0}): unsupported shell: ${PKGSHELL}" >&2
exit 1
fi
-source "$(dirname ${0})/${PKGSHELL}/pkgcore.${PKGSHELL}"
+
+if [[ ${PKGSHELL} == "bash" ]]; then
+ SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})
+else
+ SCRIPTDIR=$(dirname ${(%):-%N})
+fi
+source "${SCRIPTDIR}/${PKGSHELL}/pkgcore.${PKGSHELL}"
export PATH="$(dirname ${0})"/bin:${PATH}