dot

packages and services management
Log | Files | Refs | README

commit e40b1d2dc1aadb786fd3d4ee8cad717c625fe42f
parent 8795f74d5b8b2b97b4ae5888157f2c8d08049b0e
Author: josuah <mail@josuah.net>
Date:   Mon, 10 Oct 2016 16:32:12 -0400

Fixed link script

Diffstat:
MSCRIPTS/link.sh | 50++++++++++----------------------------------------
1 file changed, 10 insertions(+), 40 deletions(-)

diff --git a/SCRIPTS/link.sh b/SCRIPTS/link.sh @@ -4,40 +4,24 @@ CONFIG="${CONFIG:-$HOME/Config}" LOCAL="${LOCAL:-$LOCAL}" # -# Link config files that follow XDG +# Link files that follow XDG '.config' scheme. # -for xdg in 'config' 'cache' +find "$CONFIG" -type f -path '*/config/*' | while read path do - find "$CONFIG" -mindepth 2 -maxdepth 2 -type d -name "$xdg" \ - | while read name - do - name="${name#$CONFIG/}" - name="${name%/$xdg}" + name="${name#$CONFIG/}" + name="${name%/config}" - mkdir -p "$HOME/.$xdg" + file="${path#$CONFIG/$name/$xdg/}" + destination="$HOME/.$xdg/$name/$file" - find "$CONFIG/$name/$xdg/" -mindepth 1 -type f \ - | while read path - do - file="${path#$CONFIG/$name/$xdg/}" - destination="$HOME/.$xdg/$name/$file" - - mkdir -p "$(dirname "$destination")" - ln -sf "$path" "$destination" - done - done + mkdir -p "$(dirname "$destination")" + ln -sf "$path" "$destination" done # # Link all other dotfiles # -find "$CONFIG" -mindepth 2 -type f \ - ! -path '*/config/*' \ - ! -path '*/cache/*' \ - ! -path '*/build/*' \ - ! -path '*/bin/*' \ - ! -path '*/.*' \ -| while read path +find "$CONFIG" -type f -path '*/.*' ! -path "*/.git/*" | while read path do file="${path#$CONFIG/*/}" destination="$HOME/.$file" @@ -47,20 +31,6 @@ do done # -# Link embedded executables -# -mkdir -p "$LOCAL/bin" - -find "$CONFIG" -type f -path '*/bin/*' \ -| while read path -do - file="${path##*/}" - destination="$LOCAL/bin/$file" - - ln -sf "$path" "$destination" -done - -# # Delete dead links # -find -L "$PREFIX" -type l -exec rm {} \; +find "$HOME" -L "$PREFIX" -type l -exec rm {} \;