Fix dope.sh handling of empty lines in deletions file (#536)

This commit is contained in:
Mihovil Ilakovac
2025-11-05 15:35:22 +01:00
committed by GitHub
parent 02d0c90eb1
commit f0429afb33

View File

@@ -149,9 +149,18 @@ recreate_derived_dir() {
# TODO: also allow deletion of dirs.
if [ -f "${DIFF_DIR_DELETIONS}" ]; then
while IFS= read -r filepath; do
# Skip empty lines
[[ -z "$filepath" ]] && continue
local derived_dir_filepath
local rm_exit_code
derived_dir_filepath="${DERIVED_DIR}/${filepath}"
# Only delete if it exists and is a file
if [[ ! -f "$derived_dir_filepath" ]]; then
continue
fi
rm "${derived_dir_filepath}"
rm_exit_code=$?
if [ ${rm_exit_code} -eq 0 ]; then