From 44905521498fdf3eba94568be39d5ab1ec095f59 Mon Sep 17 00:00:00 2001 From: Dan Lee Date: Mon, 2 Oct 2023 16:22:40 +0100 Subject: [PATCH 1/2] add output saying how to get the right noir version --- yarn-project/noir-contracts/scripts/nargo_check.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yarn-project/noir-contracts/scripts/nargo_check.sh b/yarn-project/noir-contracts/scripts/nargo_check.sh index eea23ae217b..f3c1c8e5700 100644 --- a/yarn-project/noir-contracts/scripts/nargo_check.sh +++ b/yarn-project/noir-contracts/scripts/nargo_check.sh @@ -6,7 +6,14 @@ nargo_check() { EXPECTED_VERSION=$(jq -r '.commit' ../noir-compiler/src/noir-version.json) FOUND_VERSION=$(nargo --version | grep -o 'git version hash: [0-9a-f]*' | cut -d' ' -f4) if [ "$EXPECTED_VERSION" != "$FOUND_VERSION" ]; then - echo "Expected nargo version $EXPECTED_VERSION but found version $FOUND_VERSION. Aborting." - exit 1 + echo "Expected nargo version $EXPECTED_VERSION but found version $FOUND_VERSION." + + # Get the directory of the script and the parent directory, where its meant to be run + SCRIPT_DIR="$(dirname "$(realpath "$0")")" + PARENT_DIR="$(dirname "$SCRIPT_DIR")" + + echo "To fix the version issue, you can run the following command:" + echo "cd $PARENT_DIR && scripts/install_noir.sh" + exit 1 fi } From 25ee22d60d39abf6b6861d872cfa6dc1678a2171 Mon Sep 17 00:00:00 2001 From: Dan Lee Date: Mon, 2 Oct 2023 16:24:16 +0100 Subject: [PATCH 2/2] comment --- yarn-project/noir-contracts/scripts/nargo_check.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yarn-project/noir-contracts/scripts/nargo_check.sh b/yarn-project/noir-contracts/scripts/nargo_check.sh index f3c1c8e5700..10d9d14c2c1 100644 --- a/yarn-project/noir-contracts/scripts/nargo_check.sh +++ b/yarn-project/noir-contracts/scripts/nargo_check.sh @@ -6,12 +6,13 @@ nargo_check() { EXPECTED_VERSION=$(jq -r '.commit' ../noir-compiler/src/noir-version.json) FOUND_VERSION=$(nargo --version | grep -o 'git version hash: [0-9a-f]*' | cut -d' ' -f4) if [ "$EXPECTED_VERSION" != "$FOUND_VERSION" ]; then - echo "Expected nargo version $EXPECTED_VERSION but found version $FOUND_VERSION." + echo "Expected nargo version $EXPECTED_VERSION but found version $FOUND_VERSION. Aborting." # Get the directory of the script and the parent directory, where its meant to be run SCRIPT_DIR="$(dirname "$(realpath "$0")")" PARENT_DIR="$(dirname "$SCRIPT_DIR")" + # bootstrap.sh calls this non-interactively, so we can't just ask for confirmation to autorun this script. echo "To fix the version issue, you can run the following command:" echo "cd $PARENT_DIR && scripts/install_noir.sh" exit 1