summaryrefslogtreecommitdiffhomepage
path: root/scripts/upload-github-release-asset.sh
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-12-30 10:36:56 +0800
committertypebrook <typebrook@gmail.com>2019-12-30 10:36:56 +0800
commit9b048d334611d3d084e86a1cb28a336d1435a5ad (patch)
tree8761f15d821ab986950b7dbf101abef86c56837d /scripts/upload-github-release-asset.sh
parent4c5cc9aa1dbe4799a08cb9b0c3485a7c3eef25f7 (diff)
update
Diffstat (limited to 'scripts/upload-github-release-asset.sh')
-rwxr-xr-xscripts/upload-github-release-asset.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/upload-github-release-asset.sh b/scripts/upload-github-release-asset.sh
index 6923870..0325530 100755
--- a/scripts/upload-github-release-asset.sh
+++ b/scripts/upload-github-release-asset.sh
@@ -62,17 +62,17 @@ eval $(echo "$response" | grep -C2 "\"name\":.\+$(basename $filename)" | grep -m
62if [ "$asset_id" = "" ]; then 62if [ "$asset_id" = "" ]; then
63 echo "No need to overwrite asset" 63 echo "No need to overwrite asset"
64else 64else
65 if [ "$overwrite" ]; then 65 if [[ "$overwrite" == "true" ]] || [[ "$overwrite" == "delete" ]]; then
66 echo "Deleting asset($asset_id)... " 66 echo "Deleting asset($asset_id)... "
67 curl -X "DELETE" -H "Authorization: token $github_api_token" "https://api.github.com/repos/$owner/$repo/releases/assets/$asset_id" 67 curl -X "DELETE" -H "Authorization: token $github_api_token" "https://api.github.com/repos/$owner/$repo/releases/assets/$asset_id"
68 if [[ "$overwrite" == "delete" ]]; then
69 exit 0
70 fi
68 else 71 else
69 echo "File already exists on tag $tag" 72 echo "File already exists on tag $tag"
70 echo "If you want to overwrite it, set overwrite=true" 73 echo "If you want to overwrite it, set overwrite=true"
71 exit 1 74 exit 1
72 fi 75 fi
73 if [ "$overwrite" == "delete" ]; then
74 exit 0
75 fi
76fi 76fi
77 77
78# Upload asset 78# Upload asset