iptb-lib: small cleanup
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Feb 1, 2016 at 13:23 UTC
d1f15d445b4372b7d2051e72398f4ef511c0090a
1 file changed
+5
-4
test/sharness/lib/iptb-lib.sh
+5
-4
@@ -3,16 +3,17 @@
3
# Copyright (c) 2014, 2016 Jeromy Johnson, Christian Couder
4
# MIT Licensed; see the LICENSE file in this repository.
5
6
-export IPTB_ROOT="`pwd`/.iptb"
6
+export IPTB_ROOT="$(pwd)/.iptb"
7
8
ipfsi() {
9
dir="$1"
10
shift
11
- IPFS_PATH="$IPTB_ROOT/$dir" ipfs $@
11
+ IPFS_PATH="$IPTB_ROOT/$dir" ipfs "$@"
12
}
13
14
check_has_connection() {
15
- node=$1
16
- ipfsi $node swarm peers | grep ipfs > /dev/null
15
+ node="$1"
16
+ ipfsi "$node" swarm peers >"swarm_peers_$node" &&
17
+ grep "ipfs" "swarm_peers_$node" >/dev/null
18
}
19