Browse Source

fix entrypoint.sh: restore support for empty $IPFS_SWARM_ADDRS

Fabian Peter Hammerle 3 years ago
parent
commit
96121f7804
1 changed files with 5 additions and 1 deletions
  1. 5 1
      entrypoint.sh

+ 5 - 1
entrypoint.sh

@@ -11,7 +11,11 @@ ipfs_config_jq_edit() {
 # https://github.com/stedolan/jq/commit/66fb962a6608805f4d7667d39ad0d88158bd1262
 # compare fphammerle/docker-ipfs v0.2.0
 args_to_json_array() {
-    printf '%s\n' "$@" | jq -R . | jq -sc .
+    if [ -z "$@" ]; then
+        printf '[]\n'
+    else
+        printf '%s\n' "$@" | jq -R . | jq -sc .
+    fi
 }
 
 if [ ! -e "$IPFS_CONFIG_PATH" ]; then