Skip to content

Commit cecd23d

Browse files
committed
fix
1 parent ebd6e60 commit cecd23d

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

aztec-up/bin/aztec-install

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ else
1515
NON_INTERACTIVE=${NON_INTERACTIVE:-0}
1616
fi
1717

18-
AZTEC_PATH="${AZTEC_PATH:-$HOME/.aztec}"
19-
BIN_PATH=${BIN_PATH:-$AZTEC_PATH/bin}
18+
aztec_path=$HOME/.aztec
19+
bin_path=$aztec_path/bin
2020

2121
# For testing you can override the INSTALL_URI to point to a file uri e.g. file:///home/user/aztec-packages/aztec-up/bin
22-
if [ -z "$INSTALL_URI" ]; then
22+
if [ -z "${INSTALL_URI:-}" ]; then
2323
INSTALL_URI=https://install.aztec.network
24-
if [ -z "${VERSION:-}" ]; then
24+
if [ -n "${VERSION:-}" ]; then
2525
INSTALL_URI+="/$VERSION"
2626
fi
2727
fi
@@ -108,22 +108,22 @@ function check_toolchains {
108108
}
109109

110110
function install_file {
111-
local dest="$AZTEC_PATH/$1"
111+
local dest="$aztec_path/$1"
112112
curl -fsSL "$INSTALL_URI/$1" -o "$dest"
113113
echo "Installed: $dest"
114114
}
115115

116116
# Copy a file from the install source path to the bin path and make it executable.
117117
function install_bin {
118-
local dest="$BIN_PATH/$1"
118+
local dest="$bin_path/$1"
119119
curl -fsSL "$INSTALL_URI/$1" -o "$dest"
120120
chmod +x "$dest"
121121
echo "Installed: $dest"
122122
}
123123

124124
# Updates appropriate shell script to ensure the bin path is in the PATH.
125125
function update_path_env_var {
126-
local target_dir=$BIN_PATH
126+
local target_dir=$bin_path
127127
# Check if the target directory is in the user's PATH.
128128
if [[ ":$PATH:" == *":$target_dir:"* ]]; then
129129
return
@@ -175,29 +175,34 @@ function install_jq {
175175
;;
176176
esac
177177

178-
curl -Ls "$url_base/$bin" -o $BIN_PATH/jq || return 1
179-
chmod +x $BIN_PATH/jq
178+
curl -Ls "$url_base/$bin" -o $bin_path/jq || return 1
179+
chmod +x $bin_path/jq
180180
}
181181

182182
function install_aztec_up {
183-
rm -rf $BIN_PATH && mkdir -p $BIN_PATH
183+
set -euo pipefail
184+
mkdir -p $bin_path
185+
rm -f $bin_path/*
184186
install_bin aztec-up
185187
install_file versions
186188
update_path_env_var
187189
}
188190

189191
function install_noir {
192+
set -euo pipefail
190193
curl -Ls https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
191-
$HOME/.nargo/bin/noirup -v $(cat $AZTEC_PATH/versions | grep noir | cut -d' ' -f2)
194+
$HOME/.nargo/bin/noirup -v $(cat $aztec_path/versions | grep noir | cut -d' ' -f2)
192195
}
193196

194197
function install_foundry {
198+
set -euo pipefail
195199
curl -L https://foundry.paradigm.xyz | bash
196-
$HOME/.foundry/bin/foundryup -i $(cat $AZTEC_PATH/versions | grep foundry | cut -d' ' -f2)
200+
$HOME/.foundry/bin/foundryup -i $(cat $aztec_path/versions | grep foundry | cut -d' ' -f2)
197201
}
198202

199203
function install_aztec_packages {
200-
local version=$(cat $AZTEC_PATH/versions | grep aztec | cut -d' ' -f2)
204+
set -euo pipefail
205+
local version=$(cat $aztec_path/versions | grep aztec | cut -d' ' -f2)
201206
npm i -g @aztec/aztec@$version @aztec/cli-wallet@$version @aztec/bb.js@$version
202207
}
203208

bootstrap.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ function check_toolchains {
150150
}
151151

152152
function versions {
153-
echo "aztec: $((git describe --tags --exact-match 2>/dev/null || jq -r '."."' .release-please-manifest.json) | tr -d v)"
153+
if semver check $REF_NAME; then
154+
echo "aztec: ${REF_NAME#v}"
155+
else
156+
echo "aztec: $(jq -r '."."' .release-please-manifest.json | tr -d v)"
157+
fi
154158
echo "noir: $(git -C noir/noir-repo describe --tags --exact-match HEAD)"
155159
echo "foundry: $(anvil --version | head -n1 | sed -E 's/anvil Version: ([0-9.]+).*/\1/')"
156160
echo "node: $(node --version | cut -d 'v' -f 2)"

0 commit comments

Comments
 (0)