i just have my ~/.dot repository mirror the directory structure that it's supposed to have from $HOME, and run this script after i git pull (which i just realized i can invoke via post-merge git hook):
#!/bin/bashcd"$(dirname--"$0")"warn="\033[33;1m"# Bold Yellownew="\033[32;1m"# Bold Greenplain="\033[0m"# Reset text stylecols=$(tput cols)
puts(){local-ncolor=$1;shift
printf--'%b%s%b\n'"$color""$*""$plain"}
find .-type f \-not-name"$(basename--"$0")"\-and-not-regex'.*/\(stay\|\.git\).*'\-printf'%P\n'\
| while IFS=read-r file
do
dest="$HOME/$file"mkdir-p--"${dest%/*}"||continue
if[[!-f$dest]];then
puts new 'Creating $dest...'ln--"$file""$dest"continue
fi
if diff --"$file""$dest">/dev/null;then
ln-f--"$file""$dest"continue
fi
msg="- Updates to $file "printf-v bar '%*s'$(( cols -${#msg}))
puts warn "$msg""${bar// /–}"
diff --color-u3--"$dest""$file"printf %b "$warn"printf-v bar '%*s'$cols;printf'%s\n'"${bar// /_}"ln-i--"$file""$dest"printf %b "$plain"done
note: i also have a ~/.dot/stay directory, where i put things that i don't want to hardlink to anywhere
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
i just have my
~/.dot
repository mirror the directory structure that it's supposed to have from$HOME
, and run this script after igit pull
(which i just realized i can invoke via post-merge git hook):note: i also have a
~/.dot/stay
directory, where i put things that i don't want to hardlink to anywhere