diff --git a/barretenberg/bbup/README.md b/barretenberg/bbup/README.md index 34118f2524c..6e8ce8343d5 100644 --- a/barretenberg/bbup/README.md +++ b/barretenberg/bbup/README.md @@ -13,7 +13,7 @@ curl -L bbup.dev | bash ``` > [!IMPORTANT] -> *Always* check what scripts do. The above one redirects to [the install script](https://github.com/AztecProtocol/aztec-packages/blob/master/barretenberg/bbup/install). +> *Always* check what scripts do. The above one redirects to [the install script](https://github.com/AztecProtocol/aztec-packages/blob/master/barretenberg/bbup/install) which installs [bbup](https://github.com/AztecProtocol/aztec-packages/blob/master/barretenberg/bbup/bbup) in your system's PATH ## Usage diff --git a/barretenberg/bbup/bbup b/barretenberg/bbup/bbup index 9fda58fb522..c22a182c032 100755 --- a/barretenberg/bbup/bbup +++ b/barretenberg/bbup/bbup @@ -28,10 +28,9 @@ print_spinner() { get_bb_version_for_noir() { local noir_version=$1 local url="" + local resolved_version="" if [ "$noir_version" = "stable" ] || [ "$noir_version" = "nightly" ]; then - printf "${BLUE}Resolving noir version ${noir_version}...${NC}\n" - # Get releases from GitHub API local releases=$(curl -s "https://api.github.com/repos/noir-lang/noir/releases") @@ -41,7 +40,6 @@ get_bb_version_for_noir() { resolved_version=$(echo "$releases" | grep -o '"tag_name": "nightly[^"]*"' | head -1 | cut -d'"' -f4) fi - printf "${GREEN}${SUCCESS} Resolved noir version ${noir_version} to ${resolved_version}${NC}\n" url="https://raw.githubusercontent.com/noir-lang/noir/${resolved_version}/scripts/install_bb.sh" else url="https://raw.githubusercontent.com/noir-lang/noir/v${noir_version}/scripts/install_bb.sh" @@ -163,6 +161,18 @@ main() { if [ -n "$noir_version" ]; then printf "${BLUE}Getting compatible barretenberg version for noir version ${noir_version}${NC}\n" + if [ "$noir_version" = "stable" ] || [ "$noir_version" = "nightly" ]; then + printf "${BLUE}Resolving noir version ${noir_version}...${NC}\n" + # Get releases from GitHub API to show the resolved version + local releases=$(curl -s "https://api.github.com/repos/noir-lang/noir/releases") + local resolved_version="" + if [ "$noir_version" = "stable" ]; then + resolved_version=$(echo "$releases" | grep -o '"tag_name": "[^"]*"' | grep -v "aztec\|nightly" | head -1 | cut -d'"' -f4) + else + resolved_version=$(echo "$releases" | grep -o '"tag_name": "nightly[^"]*"' | head -1 | cut -d'"' -f4) + fi + printf "${GREEN}${SUCCESS} Resolved noir version ${noir_version} to ${resolved_version}${NC}\n" + fi version=$(get_bb_version_for_noir "$noir_version") printf "${GREEN}${SUCCESS} Resolved to barretenberg version ${version}${NC}\n" fi