Skip to content

Commit 79108ea

Browse files
infomihoclaude
andcommitted
Fix dope.sh handling of empty lines in deletions file
- Skip empty lines in deletions file to prevent attempting to delete directories - Add file existence check before deletion to avoid errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 02d0c90 commit 79108ea

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/dope.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,18 @@ recreate_derived_dir() {
149149
# TODO: also allow deletion of dirs.
150150
if [ -f "${DIFF_DIR_DELETIONS}" ]; then
151151
while IFS= read -r filepath; do
152+
# Skip empty lines
153+
[[ -z "$filepath" ]] && continue
154+
152155
local derived_dir_filepath
153156
local rm_exit_code
154157
derived_dir_filepath="${DERIVED_DIR}/${filepath}"
158+
159+
# Only delete if it exists and is a file
160+
if [[ ! -f "$derived_dir_filepath" ]]; then
161+
continue
162+
fi
163+
155164
rm "${derived_dir_filepath}"
156165
rm_exit_code=$?
157166
if [ ${rm_exit_code} -eq 0 ]; then

0 commit comments

Comments
 (0)