Skip to content

Commit

Permalink
Merge pull request NixOS#29 from obsidiansystems/better-grepping-for-…
Browse files Browse the repository at this point in the history
…correct-ipfs-address-in-tests

Clean up grepping for right ipfs address in tests
  • Loading branch information
Ericson2314 authored Jun 23, 2020
2 parents a02c2a5 + d8bd3cf commit 96a256d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ipfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@ nix-build ./fixed.nix -A good \
EMPTY_HASH=$(echo {} | ipfs dag put)

# Try to upload the content to the empty directory, fail but grab the right hash
IPFS_HASH=$(set -e; \
IPFS_ADDRESS=$(set -e; \
set -o pipefail; \
! nix copy --to ipfs://$EMPTY_HASH $(nix-build ./fixed.nix -A good) --experimental-features nix-command \
|& grep current: | awk '{print substr($2, 8, length($2))}')
|& grep current: | awk '{print $2}')

# Verify that new path is valid.
nix copy --to ipfs://$IPFS_HASH $(nix-build ./fixed.nix -A good) --experimental-features nix-command
nix copy --to $IPFS_ADDRESS $(nix-build ./fixed.nix -A good) --experimental-features nix-command

mkdir $IPFS_DST_IPFS_STORE

nix-build ./fixed.nix -A good \
--option substituters 'ipfs://'$IPFS_HASH \
--option substituters $IPFS_ADDRESS \
--store $IPFS_DST_IPFS_STORE \
--no-out-link \
-j0 \
Expand Down

0 comments on commit 96a256d

Please sign in to comment.