diff options
| Commit | b291be775847b4f51991604ff1c4e99334b576c2 (patch) | |
|---|---|---|
| Author | 2026-11-10 12:00:19 +0200 | |
| Committer | 2026-11-14 13:39:23 +0200 | |
| Files | 5f1815c99c60fb0d13bb80e3270953e71a6282ad | |
| .files-b291be775847b4f51991604ff1c4e99334b576c2.tar .files-b291be775847b4f51991604ff1c4e99334b576c2.tar.gz .files-b291be775847b4f51991604ff1c4e99334b576c2.zip | ||
| Parent | 7ab6bf2d6556ab94d36e1d73f2ec68980bd1f209 (diff) | |
fix(make): Skip empty file on directory iterations
Prevents bottomless recursion when a dir is empty
1 files changed, 8 insertions, 0 deletions
| -rwxr-xr-x | make | 8 |
@@ -24,6 +24,8 @@ no_overwrite= __merge_link() { while read -r f do + [ -z "$f" ] && continue + # Output file doesn't exist -> Create link # This is also true on broken symlinks if [ ! -e "$2/$f" ] @@ -92,6 +94,8 @@ __merge_link() { mkdir "$2/$f" while read -r ff do + [ -z "$ff" ] && continue + ln -s "$real/$ff" "$2/$f/$ff" done <<FILES $(ls -A1 "$real") @@ -129,6 +133,8 @@ link() { __remove_link() { while read -r f do + [ -z "$f" ] && continue + if [ -h "$2/$f" ] then real="$(realpath "$2/$f")" @@ -157,6 +163,8 @@ FILES # cannot be merged with the loop above (remove dirs on backtracking) while read -r f do + [ -z "$f" ] && continue + # Output file exists and is an empty directory -> Remove it # We're assuming this directory was created by the script and/or the user # will not care for empty dirs |
