From 3d4bd7095dc53b84cff5d5464b6817bfd1f9597e Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Mon, 27 Jun 2022 10:54:35 -0300 Subject: [PATCH] Make proto downloader and python setup scripts runnable from any dir --- proto-downloader/download-bisq-protos.sh | 4 ++++ python-examples/run-setup.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/proto-downloader/download-bisq-protos.sh b/proto-downloader/download-bisq-protos.sh index 9bd04ad..1a0f9e0 100755 --- a/proto-downloader/download-bisq-protos.sh +++ b/proto-downloader/download-bisq-protos.sh @@ -7,6 +7,10 @@ REPO_OWNER="bisq-network" REPO_BRANCH="master" REPO_PROTO_DIR_URL="https://raw.githubusercontent.com/$REPO_OWNER/bisq/$REPO_BRANCH/proto/src/main/proto" +# Get the script directory (relative to the current directory), cd into the directory, use pwd to get the absolute path. +export SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) +cd "$SCRIPT_DIR" + echo "Downloading Bisq protobuf files from $REPO_PROTO_DIR_URL to $PROTO_PATH directory..." echo "You can skip this step and copy your own local .proto files instead." diff --git a/python-examples/run-setup.sh b/python-examples/run-setup.sh index baeee40..f3ae362 100755 --- a/python-examples/run-setup.sh +++ b/python-examples/run-setup.sh @@ -2,6 +2,10 @@ # This script must be run from this directory. +# Get the script directory (relative to the current directory), cd into the directory, use pwd to get the absolute path. +export SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) +cd "$SCRIPT_DIR" + #################################################################################### # Install python3-venv if necessary. ####################################################################################