feat: handle case where file may not have trailing newline and parsing depends on it

This commit is contained in:
Jose Diaz-Gonzalez
2019-08-01 19:35:24 -04:00
parent f771b272e3
commit dc9d597cd8

View File

@@ -402,6 +402,11 @@ copy_from_image() {
# workaround for CHECKS file when owner is root. seems to only happen when running inside docker
cat "$TMP_FILE_COMMAND_OUTPUT" | dos2unix -l >"$DST_FILE"
# add trailing newline for certain places where file parsing depends on it
if [[ "$(tail -c1 "$DST_FILE")" != "" ]]; then
echo "" >>"$DST_FILE"
fi
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
else
return 1