From a6c7ab818a8c5f69ec93d5a7eceea5234418ed3f Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Mon, 15 Apr 2024 14:30:00 -0300 Subject: [PATCH] Improve exclusion logic in `find` command --- libexec/portzap/portzap-install | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libexec/portzap/portzap-install b/libexec/portzap/portzap-install index b407560..e858991 100755 --- a/libexec/portzap/portzap-install +++ b/libexec/portzap/portzap-install @@ -5,7 +5,6 @@ gitdir=$1 installdir=$2 revfile=$3 -artifacts=".git .gitignore .hooks .arcconfig" libexec="/usr/local/libexec/portzap" mode="u=rwX,g=rwX,o=" @@ -39,12 +38,14 @@ perform_install() { find -s . \ -maxdepth 1 \ - -exec cp -Rfv {} "${installdir}" \; \ - -exec chown -R root:_portzap "${installdir}/{}" \; \ - -exec chmod -R ${mode} "${installdir}/{}" \; - for path in ${artifacts}; do - rm -rf "${installdir:?}/${path}" - done + ! -name "." \ + ! -name ".git" \ + ! -name ".gitignore" \ + ! -name ".hooks" \ + ! -name ".arcconfig" \ + -exec cp -Rfv {} "${installdir}" \; + chown -Rv root:_portzap "${installdir}" + chmod -Rv "${mode}" "${installdir}" } run_install()