Skip to content

Commit

Permalink
Clean up grepping for right ipfs address in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meditans committed Jun 23, 2020
1 parent a02c2a5 commit d8bd3cf
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 d8bd3cf

Please sign in to comment.