Skip to content

Commit

Permalink
Stop using sed -i, as it doesn't seem portable.
Browse files Browse the repository at this point in the history
On BSD systems like OS X, sed -i '' disables saving backup files, but
this doesn't work with GNU sed. GNU sed's way of disabling backup files
seems to be to just not provide an argument to -i, which doesn't work
with BSD sed. Instead, just refactor test code so that sed -i isn't
used.
  • Loading branch information
fragglet committed Mar 8, 2015
1 parent 00044d8 commit 167ff15
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/test-extract
Expand Up @@ -211,10 +211,9 @@ lha_check_output() {
local output="$wd/output.txt"

cd "$run_sandbox"
test_lha "$@" >"$output" 2>&1

# Invoke test command and save output.
# test outputs have their test root as '/tmp'; adjust accordingly
sed -i '' -e "s,$wd,/tmp,g" "$output"
test_lha "$@" 2>&1 | sed "s,$wd,/tmp,g" > "$output"

cd "$test_base"

Expand Down

0 comments on commit 167ff15

Please sign in to comment.