reorder attic token check

This commit is contained in:
Charles Hall 2025-07-30 09:40:08 -07:00
parent 7fc39b1845
commit 47c210d5de

View file

@ -10,14 +10,6 @@ just() {
nix build "$@"
fi
if [ -z ${ATTIC_TOKEN+x} ]; then
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
return
fi
nix run --inputs-from . attic#default -- \
login "$ATTIC_SERVER" "$ATTIC_ENDPOINT" "$ATTIC_TOKEN"
# Find all output paths of the installables and their build dependencies
readarray -t derivations < <(nix path-info --derivation "$@")
readarray -t cache < <(
@ -26,6 +18,14 @@ just() {
<<< "${derivations[*]}"
)
if [ -z ${ATTIC_TOKEN+x} ]; then
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
return
fi
nix run --inputs-from . attic#default -- \
login "$ATTIC_SERVER" "$ATTIC_ENDPOINT" "$ATTIC_TOKEN"
# Upload them to Attic. It seems to insist on newlines to separate the
# paths.
(