소스 검색

fix entrypoint.sh: restore support for empty $IPFS_SWARM_ADDRS

Fabian Peter Hammerle 3 년 전
부모
커밋
96121f7804
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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