]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
scripts/test: make MacOS compatible
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>
Wed, 8 Dec 2021 06:23:54 +0000 (07:23 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Wed, 8 Dec 2021 07:38:22 +0000 (08:38 +0100)
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.

scripts/clean/server/test.sh

index f85daf810b162161370eca0fb6dd485ef621a3cd..5c30c7639b1d71c3ae8bbedcddca92dc84b7f87a 100755 (executable)
@@ -20,9 +20,9 @@ dropRedis () {
   port=$((9000+$1))
   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 "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 --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 -r 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)