1
0
mirror of https://github.com/sstephenson/bats.git synced 2026-02-25 17:28:11 +01:00

Supporting DOS line endings in BATS tests

This commit is contained in:
Adam Jacob
2013-05-22 21:20:39 -04:00
parent 6116ef6b23
commit 9c8425d005
3 changed files with 9 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ BATS_OUT="${BATS_TMPNAME}.out"
bats_preprocess_source() {
BATS_TEST_SOURCE="${BATS_TMPNAME}.src"
bats-preprocess < "$BATS_TEST_FILENAME" > "$BATS_TEST_SOURCE"
cat "$BATS_TEST_FILENAME" | tr -d '\r' | bats-preprocess > "$BATS_TEST_SOURCE"
trap bats_cleanup_preprocessed_source err exit
trap "bats_cleanup_preprocessed_source; exit 1" int
}