From 811dc1f2bfc7b0481cc36dd7c03bef213435b50d Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 28 Jan 2023 21:26:20 -0800 Subject: [PATCH] Fix Backblaze B2 Uploader --- tools/gh-upload-backblaze.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/gh-upload-backblaze.sh b/tools/gh-upload-backblaze.sh index f7955bc..f825bbe 100755 --- a/tools/gh-upload-backblaze.sh +++ b/tools/gh-upload-backblaze.sh @@ -2,8 +2,13 @@ set -e BACKBLAZE_B2_VERSION="3.6.0" +BACKBLAZE_B2_PLATFORM="linux" +BACKBLAZE_B2_REPO="https://github.com/Backblaze/B2_Command_Line_Tool" -curl -sL -o b2 "https://github.com/Backblaze/B2_Command_Line_Tool/releases/download/v${BACKBLAZE_B2_VERSION}/b2-linux" +[ "$(uname -s)" = "Darwin" ] && BACKBLAZE_B2_PLATFORM="darwin" + +curl --fail -sL -o b2 "${BACKBLAZE_B2_REPO}/releases/download/v${BACKBLAZE_B2_VERSION}/b2-${BACKBLAZE_B2_PLATFORM}" chmod +x b2 ./b2 authorize-account "${ARTIFACTS_KEY_ID}" "${ARTIFACTS_APP_KEY}" -./b2 sync --delete --replaceNewer artifacts/ "b2:///${ARTIFACTS_BUCKET}/foundation/" +./b2 sync --delete --replaceNewer --allowEmptySource artifacts/ "b2://${ARTIFACTS_BUCKET}/foundation/" +rm b2