]> https://gitweb.dealii.org/ - candi.git/commitdiff
fix enable.sh for zsh 247/head
authorTimo Heister <timo.heister@gmail.com>
Sat, 24 Jul 2021 21:48:37 +0000 (17:48 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sat, 24 Jul 2021 21:48:37 +0000 (17:48 -0400)
default on OSX is zsh instead of bash and our enable.sh uses a bash
internal. This should work for bash and zsh.

candi.sh

index 3d5bf2db67d2e409b48152a2a6d07ce1cc36a3ff..c7f766ab55633e34e11523797d2514472c14ab5a 100755 (executable)
--- a/candi.sh
+++ b/candi.sh
@@ -1023,7 +1023,9 @@ cat > ${CONFIGURATION_PATH}/enable.sh <<"EOF"
 
 # find path of script:
 pushd . >/dev/null
-P="${BASH_SOURCE[0]}";cd `dirname $P`;P=`pwd`;
+P="${BASH_SOURCE[0]:-${(%):-%x}}";
+P=`dirname ${P}`;
+P=`cd ${P};pwd`;
 popd >/dev/null
 
 for f in $P/*

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.