Summary Files Commits Branches @commit @diff @stats
path: root / make
diff options
context:
space:
mode:
1 files changed, 8 insertions, 0 deletions
-rwxr-xr-xmake8
diff --git a/make b/make
index ae424fe..110ef88 100755
--- a/make
+++ b/make
@@ -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