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).
This commit is contained in:
Sean Young 2021-09-16 00:05:10 +01:00
parent 4675fa6c46
commit 2762f6f96f
1 changed files with 7 additions and 1 deletions

View File

@ -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