Skip to content

Commit 002d790

Browse files
committed
Updating release script
1 parent b35c00d commit 002d790

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

script/release

+5-13
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ readonly TARGETS=('darwin/amd64' 'linux/amd64' 'linux/arm' 'linux/arm64')
88

99
read_variable_if_required() {
1010
if [[ -z "${!1:-}" ]]; then
11-
read -r -p "${2:-${1}=}" "${1}"
11+
read -r -p "${2:-${1}}${3:+ [${3}]}=" READ_VALUE
12+
eval "${1}=${READ_VALUE:-${3}}"
1213
else
1314
echo "${1}=${!1}"
1415
fi
@@ -78,17 +79,10 @@ get_release_body() {
7879
}
7980

8081
release() {
81-
local GITHUB_REPOSITORY
82-
GITHUB_REPOSITORY="$(get_github_repository)"
83-
local GIT_TAG
84-
GIT_TAG="$(get_last_tag)"
85-
local RELEASE_NAME
86-
RELEASE_NAME="${GIT_TAG}"
87-
8882
read_variable_if_required GITHUB_OAUTH_TOKEN
89-
read_variable_if_required GITHUB_REPOSITORY
90-
read_variable_if_required GIT_TAG
91-
read_variable_if_required RELEASE_NAME
83+
read_variable_if_required GITHUB_REPOSITORY "Repository" "$(get_github_repository)"
84+
read_variable_if_required GIT_TAG "Tag" "$(get_last_tag)"
85+
read_variable_if_required RELEASE_NAME "Release name" "$(get_last_tag)"
9286

9387
local RED='\033[0;31m'
9488
local GREEN='\033[0;32m'
@@ -104,7 +98,6 @@ release() {
10498
local OUTPUT_TXT="output.txt"
10599
local CLIENT_ARGS=("curl" "-q" "-sS" "-o" "${OUTPUT_TXT}" "-w" "%{http_code}" "-H" "Authorization: token ${GITHUB_OAUTH_TOKEN}")
106100

107-
echo
108101
local HTTP_STATUS
109102
HTTP_STATUS="$("${CLIENT_ARGS[@]}" \
110103
-H "Content-Type: application/json" \
@@ -128,7 +121,6 @@ release() {
128121

129122
for asset in "${OUTPUT_DIR}"/*; do
130123
echo -e "${BLUE}Uploading asset ${asset}...${RESET}"
131-
echo
132124

133125
local HTTP_STATUS
134126
HTTP_STATUS="$("${CLIENT_ARGS[@]}" \

0 commit comments

Comments
 (0)