Commit a3de9bf3 authored by Tommi Virtanen's avatar Tommi Virtanen Committed by Jeromy

sharness: Use sed in a cross-platform safe way

OS X sed is documented as "-i SUFFIX", GNU sed as "-iSUFFIX". The one
consistent case seems to be "-iSUFFIX", where suffix cannot empty (or
OS X will parse the next argument as the suffix).

This used to leave around files named `refsout=` on Linux, and was
just confusing.

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent c0ec3772
......@@ -138,7 +138,7 @@ test_expect_success "adding multiblock random file succeeds" '
test_expect_success "'ipfs pin ls --type=indirect' is correct" '
ipfs refs "$MBLOCKHASH" >refsout &&
ipfs refs -r "$HASH_WELCOME_DOCS" >>refsout &&
sed -i="" "s/\(.*\)/\1 indirect/g" refsout &&
sed -i"~" "s/\(.*\)/\1 indirect/g" refsout &&
ipfs pin ls --type=indirect >indirectpins &&
test_sort_cmp refsout indirectpins
'
......@@ -166,7 +166,7 @@ test_expect_success "'ipfs pin ls --type=recursive' is correct" '
echo "$HASH_WELCOME_DOCS" >>rp_expected &&
echo "$EMPTY_DIR" >>rp_expected &&
ipfs refs -r "$HASH_WELCOME_DOCS" >>rp_expected &&
sed -i="" "s/\(.*\)/\1 recursive/g" rp_expected &&
sed -i"~" "s/\(.*\)/\1 recursive/g" rp_expected &&
ipfs pin ls --type=recursive >rp_actual &&
test_sort_cmp rp_expected rp_actual
'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment