Open andsens opened 11 years ago
+1. I'm not sure of etiquette here. Is hitting "watch thread" enough to register my interest, or does the +1 help?
Since this is still an issue how about something like this in the symlink command:
for deadlink in $(find -xtype l -exec ls -1 {} \;); do
if [ $(readlink $deadlink | grep ${repo}/home) ]; then
pending 'deadlink' "$filename"
rm $deadlink && success || err $EX_ERR "Could not delete $deadlink"
fi
done
That would mean you'd have to enumerate everything in $HOME
(think people with a /music folder etc.), I think calling git with --diff-filter=D
is the more sensible option here. I'll start working on it soon.
I did much bash scripting the last weeks maybe i was too fixed on finding the solution with bash instead looking into git options.
You are right this is a much better way
What about removing dead links which symlink to something in a castle?
What about removing dead links which symlink to something in a castle?
As I said above: You'd have to iterate through everything in the home dir. It's just not feasible.
I recently had the issue where I was missing the unlink command, though it should probably be called clean
. The following would be able to find all files in home/
that have been deleted since a castles inception: git diff --name-only --diff-filter=D $(git log --reverse --pretty=format:%h | head -n1) -- home
Homeshick has a check which determines whether the user should be asked about symlinking newly added files.
Similarly we could add an unlink command which removes symlinks to deleted files.