From a3de9bf3a0ef5fd20eaf361ef03441fc86bb1741 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Mon, 11 May 2015 09:18:49 -0700 Subject: [PATCH] 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: Jeromy --- test/sharness/t0080-repo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0080-repo.sh b/test/sharness/t0080-repo.sh index 56cd84764..63fa5ee5e 100755 --- a/test/sharness/t0080-repo.sh +++ b/test/sharness/t0080-repo.sh @@ -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 '