Skip to content

Commit b9f7e78

Browse files
jlebondustymabe
authored andcommitted
cmd-build: always insert build before pruning
We had this really subtle interaction going on between cosa build and prune, where we were actually relying on the prune code to regenerate `builds.json` to add the new build we just did. There's history there on how we got here, but at this point it just feels weird. It's cleaner to always insert the new build ourselves and then separately call `cosa prune` so let's do that.
1 parent bf90d46 commit b9f7e78

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cmd-build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,8 @@ rm -rf "${tmp_builddir}"
648648
# Replace the latest link
649649
ln -Tsf "${buildid}" builds/latest
650650

651-
if [ "${SKIP_PRUNE}" == 1 ]; then
652-
insert_build "${buildid}" "${workdir}"
653-
else
651+
insert_build "${buildid}" "${workdir}"
652+
if [ "${SKIP_PRUNE}" == 0 ]; then
654653
"${dn}"/cmd-prune --workdir "${workdir}"
655654
fi
656655

0 commit comments

Comments
 (0)