mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 11:36:50 +03:00
fix: include filename in log and remove temp file on CRLF-to-LF conversion
This commit is contained in:
@@ -293,10 +293,10 @@ convert_crlf_to_lf() {
|
|||||||
local filepath="$1"
|
local filepath="$1"
|
||||||
|
|
||||||
if grep -q $'\r' "$filepath"; then
|
if grep -q $'\r' "$filepath"; then
|
||||||
log "Downloaded file has Windows line endings (CRLF). Converting to Unix (LF)" "debug"
|
log "File '$filepath' contains CRLF line endings. Converting to LF..." "debug"
|
||||||
local tmpfile
|
local tmpfile
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
tr -d '\r' < "$filepath" > "$tmpfile" && mv "$tmpfile" "$filepath"
|
tr -d '\r' < "$filepath" > "$tmpfile" && mv "$tmpfile" "$filepath" || rm -f "$tmpfile"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user