dot

packages and services management
Log | Files | Refs | README

commit c976cde3186bfe17885589c6c3e6a268162f2c84
parent fa4a674ee5a6f17e81a324cdd877933cd5ea7599
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 24 Mar 2018 13:25:46 +0100

configure script with two find commands

Diffstat:
Mconfigure | 28+++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/configure b/configure @@ -5,24 +5,26 @@ cd "$0/.." mkdir -p "$HOME/var" "$SVDIR" "$HOME/.config/enchive" -mkdir='mkdir -p "$0/$1"' -symln='ln -sf "$PWD/$1" "$0/$1"' +mkdir='mkdir -p "$0/$1";:' +symln='ln -sf "$PWD/$1" "$0/$1";:' -# symlink ./* into ~/.config/* -# symlink ./.* into ~/* -find . \ +# symlink ./[!.]* into ~/.config/* +find * \ + -path './README' -prune -o \ + -path './configure' -prune -o \ + -path './man/*' -prune -o \ -path './runit/*' -prune -o \ + -type d -exec sh -c "$mkdir" "$HOME/.config" {} ';' -o \ + -type f -exec sh -c "$symln" "$HOME/.config" {} ';' + +# symlink ./.* into ~/.* +find .* \ -name '.git' -prune -o \ -path './.' -prune -o \ -path './..' -prune -o \ - -path './.*' -a '(' \ - -type d -exec sh -c "$mkdir" "$HOME/.config" {} ';' -o \ - -type f -exec sh -c "$symln" "$HOME/.config" {} ';' \ - ')' -o '(' \ - -type d -exec sh -c "$mkdir" "$HOME" {} ';' -o \ - -type f -exec sh -c "$symln" "$HOME" {} ';' -o \ - -type l -exec sh -c "$symln" "$HOME" {} ';' \ - ')' + -type d -exec sh -c "$mkdir" "$HOME" {} ';' -o \ + -type f -exec sh -c "$symln" "$HOME" {} ';' -o \ + -type l -exec sh -c "$symln" "$HOME" {} ';' find -L "$HOME" -type l -exec rm {} +