scripts/test: make MacOS compatible

man xargs:
     -r      Compatibility with GNU xargs.  The GNU version of xargs runs the utility argument at least once, even if xargs input is empty, and it supports a -r option to inhibit this
             behavior.  The FreeBSD version of xargs does not run the utility argument on empty input, but it supports the -r option for command-line compatibility with GNU xargs, but the
             -r option does nothing in the FreeBSD version of xargs.
This commit is contained in:
kontrollanten 2021-12-08 07:23:54 +01:00 committed by Chocobozzz
parent f307255e69
commit 875c402bab
1 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,9 @@ dropRedis () {
port=$((9000+$1)) port=$((9000+$1))
host="localhost" host="localhost"
redis-cli -h "$host" KEYS "bull-localhost:$port*" | grep -v empty | xargs --no-run-if-empty redis-cli -h "$host" DEL redis-cli -h "$host" KEYS "bull-localhost:$port*" | grep -v empty | xargs -r redis-cli -h "$host" DEL
redis-cli -h "$host" KEYS "redis-localhost:$port*" | grep -v empty | xargs --no-run-if-empty redis-cli -h "$host" DEL redis-cli -h "$host" KEYS "redis-localhost:$port*" | grep -v empty | xargs -r redis-cli -h "$host" DEL
redis-cli -h "$host" KEYS "*redis-localhost:$port-" | grep -v empty | xargs --no-run-if-empty redis-cli -h "$host" DEL redis-cli -h "$host" KEYS "*redis-localhost:$port-" | grep -v empty | xargs -r redis-cli -h "$host" DEL
} }
seq=$(seq 1 6) seq=$(seq 1 6)