From cc81d0b3ee2850381c492b2f48962d69eb354cc0 Mon Sep 17 00:00:00 2001 From: bnkai <48220860+bnkai@users.noreply.github.com> Date: Tue, 3 Nov 2020 02:54:59 +0200 Subject: [PATCH] Migrate PR build storage from transfer.sh to Gofile.io (#916) --- scripts/upload-pull-request.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/upload-pull-request.sh b/scripts/upload-pull-request.sh index 54807b6d7..e4d0214d3 100644 --- a/scripts/upload-pull-request.sh +++ b/scripts/upload-pull-request.sh @@ -5,9 +5,18 @@ uploadFile() { FILE=$1 BASENAME="$(basename "${FILE}")" + # get available server from gofile api + server=$(curl https://apiv2.gofile.io/getServer |cut -d "," -f 2 | cut -d "\"" -f 6) # abort if it takes more than two minutes to upload - uploadedTo=`curl -m 120 --upload-file $FILE "https://transfer.sh/$BASENAME"` - echo "$BASENAME uploaded to url: $uploadedTo" + uploadedTo=$(curl -m 120 -F "email=stash@stashapp.cc" -F "file=@$FILE" "https://$server.gofile.io/uploadFile") + resp=$(echo "$uploadedTo" | cut -d "\"" -f 4) + if [ $resp = "ok" ] ; then + URL=$(echo "$uploadedTo"|cut -d "," -f 2 | cut -d "\"" -f 6) + echo "$BASENAME uploaded to url: \"https://gofile.io/d/$URL\"" + fi + # print an extra newline + echo + } uploadFile "dist/stash-osx"