Merge pull request #9 from viric/pull-pipefail
nixos-rebuild: make 'pull' fail in case it did not pull anything.
This commit is contained in:
commit
7acfd8ec20
|
@ -125,9 +125,13 @@ fi
|
|||
# Pull the manifests defined in the configuration (the "manifests"
|
||||
# attribute). Wonderfully hacky.
|
||||
if [ -n "$pullManifest" -o "$action" = pull ]; then
|
||||
set -o pipefail
|
||||
manifests=$(nix-instantiate --eval-only --xml --strict '<nixos>' -A manifests \
|
||||
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')
|
||||
|
||||
set -o nopipefail
|
||||
if [ $? -ne 0 ]; then exit 1; fi
|
||||
|
||||
mkdir -p /nix/var/nix/channel-cache
|
||||
for i in $manifests; do
|
||||
NIX_DOWNLOAD_CACHE=/nix/var/nix/channel-cache nix-pull $i || true
|
||||
|
|
Loading…
Reference in New Issue