diff options
author | typebrook <typebrook@gmail.com> | 2020-03-08 23:21:20 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-08 23:21:20 +0800 |
commit | 24455d691ffd40100835ff9a0d547b6aad09f9bf (patch) | |
tree | 6aa99169275e371646705a79b4a4c77b126c9763 /tools | |
parent | 00baba04c37ad1946ddeeec7bf80bc8e0582e57f (diff) |
update
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/upload-github-release-asset.sh | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/upload-github-release-asset.sh b/tools/upload-github-release-asset.sh index 0325530..0dbf71a 100755 --- a/tools/upload-github-release-asset.sh +++ b/tools/upload-github-release-asset.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env sh |
2 | # | 2 | # |
3 | # Author: Stefan Buck | 3 | # Author: Stefan Buck |
4 | # License: MIT | 4 | # License: MIT |
@@ -39,10 +39,8 @@ GH_API="https://api.github.com" | |||
39 | GH_REPO="$GH_API/repos/$owner/$repo" | 39 | GH_REPO="$GH_API/repos/$owner/$repo" |
40 | GH_TAGS="$GH_REPO/releases/tags/$tag" | 40 | GH_TAGS="$GH_REPO/releases/tags/$tag" |
41 | AUTH="Authorization: token $github_api_token" | 41 | AUTH="Authorization: token $github_api_token" |
42 | WGET_ARGS="--content-disposition --auth-no-challenge --no-cookie" | ||
43 | CURL_ARGS="-LJO#" | ||
44 | 42 | ||
45 | if [[ "$tag" == 'LATEST' ]]; then | 43 | if [ "$tag" = 'LATEST' ]; then |
46 | GH_TAGS="$GH_REPO/releases/latest" | 44 | GH_TAGS="$GH_REPO/releases/latest" |
47 | fi | 45 | fi |
48 | 46 | ||
@@ -62,10 +60,10 @@ eval $(echo "$response" | grep -C2 "\"name\":.\+$(basename $filename)" | grep -m | |||
62 | if [ "$asset_id" = "" ]; then | 60 | if [ "$asset_id" = "" ]; then |
63 | echo "No need to overwrite asset" | 61 | echo "No need to overwrite asset" |
64 | else | 62 | else |
65 | if [[ "$overwrite" == "true" ]] || [[ "$overwrite" == "delete" ]]; then | 63 | if [ "$overwrite" = "true" ] || [ "$overwrite" = "delete" ]; then |
66 | echo "Deleting asset($asset_id)... " | 64 | 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" | 65 | 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 | 66 | if [ "$overwrite" = "delete" ]; then |
69 | exit 0 | 67 | exit 0 |
70 | fi | 68 | fi |
71 | else | 69 | else |