Fix xargs do not run if empty

This commit is contained in:
G.J.R. Timmer 2021-07-05 01:22:21 +02:00
parent a1608a1d3c
commit d76a6d56cd

View File

@ -23,13 +23,13 @@ if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then
echo "setting permissions::configuration" echo "setting permissions::configuration"
CORES=$(nproc --all) CORES=$(nproc --all)
find /config -maxdepth 4 -mindepth 1 -path /config/workspace -prune -false -o -type d -print0 | \ find /config -maxdepth 4 -mindepth 1 -path /config/workspace -prune -false -o -type d -print0 | \
xargs --max-args=1 --max-procs=$((CORES*2*8)) \ xargs -r --max-args=1 --max-procs=$((CORES*2*8)) \
chown -R abc:abc chown -R abc:abc
echo "setting permissions::workspace" echo "setting permissions::workspace"
chown abc:abc /config/workspace chown abc:abc /config/workspace
find /config/workspace -maxdepth 4 -mindepth 1 -type d -print0 | \ find /config/workspace -maxdepth 4 -mindepth 1 -type d -print0 | \
xargs --max-args=1 --max-procs=$((CORES*2*16)) \ xargs -r --max-args=1 --max-procs=$((CORES*2*16)) \
chown -R abc:abc chown -R abc:abc
else else
chown -R abc:abc \ chown -R abc:abc \