From 2762f6f96f28271f02f05f0f438a870fae3bb660 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Thu, 16 Sep 2021 00:05:10 +0100 Subject: [PATCH] Fix solana docker image The docker image fails with: /usr/bin/solana-run.sh: line 66: ./fetch-spl.sh: No such file or directory In the solana docker image, scripts/run.sh is copied to /usr/bin/solana-run.sh and fetch-spl.sh to /usr/bin/fetch-spl.sh. This means that the line: cd "$(dirname "$0")/.." means we're doing a "cd /usr", which means we can't find fetch-spl.sh or spl-genesis-args.sh (i.e., the error above). --- scripts/run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 1754a9ad8c..64ba1803a1 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -8,7 +8,13 @@ set -e # Prefer possible `cargo build` binaries over PATH binaries -cd "$(dirname "$0")/.." +script_dir="$(readlink -f "$(dirname "$0")")" +if [[ "$script_dir" =~ /scripts$ ]]; then + cd "$script_dir/.." +else + cd "$script_dir" +fi + profile=debug if [[ -n $NDEBUG ]]; then