feat: handle case where file may not have trailing newline and parsing depends on it
This commit is contained in:
@@ -402,6 +402,11 @@ copy_from_image() {
|
|||||||
# workaround for CHECKS file when owner is root. seems to only happen when running inside docker
|
# 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"
|
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
|
"$DOCKER_BIN" rm -f "$CID" &>/dev/null
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user