Skip to content

Commit 827f5a7

Browse files
committed
Updated DependencyInstaller.sh env.sh script to support ZSH.
Signed-off-by: Ted Hong <[email protected]>
1 parent 2646ce3 commit 827f5a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

etc/DependencyInstaller.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ _installCommonDev() {
289289
if [[ ! -z ${PREFIX} ]]; then
290290
# Emit an environment setup script
291291
cat > ${PREFIX}/env.sh <<EOF
292-
depRoot="\$(dirname \$(readlink -f "\${BASH_SOURCE[0]}"))"
292+
if [ -n "\$ZSH_VERSION" ]; then
293+
depRoot="\$(dirname \$(readlink -f "\${(%):-%x}"))"
294+
else
295+
depRoot="\$(dirname \$(readlink -f "\${BASH_SOURCE[0]}"))"
296+
fi
297+
293298
PATH=\${depRoot}/bin:\${PATH}
294299
LD_LIBRARY_PATH=\${depRoot}/lib64:\${depRoot}/lib:\${LD_LIBRARY_PATH}
295300
EOF

0 commit comments

Comments
 (0)