Skip to content

Commit 48f3e7d

Browse files
authored
Merge pull request #8285 from hongted/build-zsh
Updated DependencyInstaller.sh env.sh script to support ZSH.
2 parents f4d2f0e + 827f5a7 commit 48f3e7d

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
@@ -306,7 +306,12 @@ _installCommonDev() {
306306
if [[ ! -z ${PREFIX} ]]; then
307307
# Emit an environment setup script
308308
cat > ${PREFIX}/env.sh <<EOF
309-
depRoot="\$(dirname \$(readlink -f "\${BASH_SOURCE[0]}"))"
309+
if [ -n "\$ZSH_VERSION" ]; then
310+
depRoot="\$(dirname \$(readlink -f "\${(%):-%x}"))"
311+
else
312+
depRoot="\$(dirname \$(readlink -f "\${BASH_SOURCE[0]}"))"
313+
fi
314+
310315
PATH=\${depRoot}/bin:\${PATH}
311316
LD_LIBRARY_PATH=\${depRoot}/lib64:\${depRoot}/lib:\${LD_LIBRARY_PATH}
312317
EOF

0 commit comments

Comments
 (0)