Skip to content

Commit f753b35

Browse files
committed
fix(pin-standard-build): refuse to tarball on build failure or missing artifact
1 parent b8403db commit f753b35

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

noir-projects/noir-contracts/bootstrap.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,11 @@ function format {
233233
function pin-standard-build {
234234
rm -f pinned-standard-contracts.tar.gz
235235
local standard_contracts=$(grep -oP '(?<=contracts/)[^"]+' Nargo.toml | grep "^standard/")
236-
build $standard_contracts
236+
build $standard_contracts || { echo_stderr "Build failed; refusing to create tarball."; return 1; }
237237
local standard_artifacts=$(jq -r '.[]' standard_contracts.json | sed 's/$/.json/')
238+
for a in $standard_artifacts; do
239+
[ -f "target/$a" ] || { echo_stderr "Missing artifact target/$a; refusing to create tarball."; return 1; }
240+
done
238241
echo_stderr "Creating pinned-standard-contracts.tar.gz..."
239242
(cd target && tar czf ../pinned-standard-contracts.tar.gz $standard_artifacts)
240243
echo_stderr "Done. pinned-standard-contracts.tar.gz created. Commit it to pin these artifacts."

0 commit comments

Comments
 (0)