From f376d50d5a2718e6a7755e5a501f46333e3c09d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Grosdidier?= Date: Thu, 5 Dec 2019 20:44:02 +0100 Subject: [PATCH] Added support for macos-specific base64 decoding (-D instead of -d) --- ipfs-wormhole.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ipfs-wormhole.sh b/ipfs-wormhole.sh index 47aea88..3ceefb6 100755 --- a/ipfs-wormhole.sh +++ b/ipfs-wormhole.sh @@ -131,7 +131,15 @@ receive) # Handle user input USERINPUT=${2:-} IPFSHASH=${USERINPUT%%-*} - DSTFILENAME="$(echo "${USERINPUT##*-}" | base64 -d)" + case "$OSTYPE" in + linux-gnu) + BASE64FLAG="-d" + ;; + darwin*) + BASE64FLAG="-D" + ;; + esac + DSTFILENAME="$(echo "${USERINPUT##*-}" | base64 $BASE64FLAG)" PASSWORD=${USERINPUT%-*} PASSWORD=${PASSWORD#*-}