From 145a387e7872551406e1a09fd1a703cd1e787041 Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Fri, 24 Nov 2023 12:30:20 +0200 Subject: [PATCH] use a more robust way for getting the script directory This fixes calling the script from dash (cherry picked from commit 7c5be21ac6ad665d15b0e2c7701889387c6f24db) --- run-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-all.sh b/run-all.sh index 138eca2..7de4e2d 100755 --- a/run-all.sh +++ b/run-all.sh @@ -1,7 +1,7 @@ #!/bin/bash yaml_list() { - test -n "${BASH_SOURCE[0]}" && DIR="$(dirname "${BASH_SOURCE[0]}")" || DIR=. + DIR="$(dirname -- "$(readlink "$0")")" python3 -c "import yaml;print(' '.join(yaml.safe_load(open('$DIR/environment.yml'))['$1']))" }