From c657bbb8f9c2d6da3706469b6bcf44febd58c7f1 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 10 May 2019 03:31:32 +0200 Subject: [PATCH] Simplify dotfiles.sh file exclusion --- dotfiles.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dotfiles.sh b/dotfiles.sh index 97327be..86ca4dd 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -7,11 +7,8 @@ fi PACKAGE_FILE="./packages" -FILES="$(find . \( -path ./.git -o \ - -path ./dotfiles.sh -o \ - -path $PACKAGE_FILE -o \ - -path ./README.md -o \ - -path ./screenshot.png \) -prune -o -type f -print)" +EXCLUDE="./.git|$0|$PACKAGE_FILE|./README.md|./screenshot.png" +FILES="$(find . -type f | awk -v e="^($EXCLUDE)" '$0 !~ e { print $0 }')" help() { B=$(tput bold)