diff options
author | Mike Burns <mike@mike-burns.com> | 2015-11-20 14:21:02 +0100 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2015-11-20 14:22:11 +0100 |
commit | a68804713a6cb9eb96278df597fd0b4fefc36598 (patch) | |
tree | f813d00249161824b96d5e8c8629559369c85aa6 | |
parent | 4cd7fd891c80169188705243bb2fdba44bb1edbe (diff) |
rcdn(1) recurs until home dir, not root
rcdn(1) will try to remove a file; if it is not a dotfile, it will keep
going up until it found one. However, we should stop at `$DEST_DIR`
(`$HOME`) -- nothing is relevant to us above there.
Closes #169.
-rwxr-xr-x | bin/rcdn.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/rcdn.in b/bin/rcdn.in index ae7aad8..a2a8472 100755 --- a/bin/rcdn.in +++ b/bin/rcdn.in @@ -8,7 +8,9 @@ remove_link() { local original="$2" local sigil="$3" - if [ "x$dest" = "x/" ]; then + $DEBUG "remove_link $1 $2 $3" + + if [ "x$dest" = "x/" -o "x$dest" = "x$DEST_DIR" ]; then $VERBOSE "not a symlink, skipping: $original" elif [ -L "$dest" -o "x$sigil" = "xX" ]; then rm_v -rf "$dest" |