Skip to content

Commit

Permalink
chore: add output saying how to get the right noir version (#2622)
Browse files Browse the repository at this point in the history
hopefully saves a little time when the version is mismatched
  • Loading branch information
dan-aztec authored and Maddiaa0 committed Oct 5, 2023
1 parent 6a72a66 commit 44c85be
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions yarn-project/noir-contracts/scripts/nargo_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ 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. 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
fi
}

0 comments on commit 44c85be

Please sign in to comment.