refactor(sync): sudo xargs with verbose output so we see which files had their owner changed

This commit is contained in:
hygienic-books 2023-03-16 23:55:09 +01:00
parent 77fe5ce050
commit 4bfbb54a54

@ -70,7 +70,7 @@ if we_are_ahead || [[ "${do_force}" == 'true' ]]; then
if [[ "${do_force}" == 'true' ]]; then
sudo --preserve-env=SSH_AUTH_SOCK su --shell /bin/bash --command 'cd; sudo --preserve-env=SSH_AUTH_SOCK git reset --hard' "${account}"
fi
sudo --preserve-env=SSH_AUTH_SOCK su --shell /bin/bash --command 'cd; sudo --preserve-env=SSH_AUTH_SOCK git pull; sudo find '"'"'.'"'"' \( -not -user '"${account}"' -or -not -group '"${account}"' \) -print0 | xargs --no-run-if-empty --null -I '"'"'{}'"'"' chown '"${account}"':'"${account}"' '"'"'{}'"'"'' "${account}"
sudo --preserve-env=SSH_AUTH_SOCK su --shell /bin/bash --command 'cd; sudo --preserve-env=SSH_AUTH_SOCK git pull; sudo find '"'"'.'"'"' \( -not -user '"${account}"' -or -not -group '"${account}"' \) -print0 | sudo xargs --no-run-if-empty --null -I '"'"'{}'"'"' chown --verbose '"${account}"':'"${account}"' '"'"'{}'"'"'' "${account}"
done
else
pprint 'Nothing to do'