Skip to content

Commit 473e292

Browse files
Merge pull request #63 from codecov/th/add-back-in-shorten
fix: add in shorten and new release
2 parents 9869a62 + 76b5d63 commit 473e292

File tree

4 files changed

+169
-163
lines changed

4 files changed

+169
-163
lines changed

dist/codecov.sh

Lines changed: 137 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ say() {
55
}
66
exit_if_error() {
77
say "$r==> $1$x"
8-
if [ "$CODECOV_FAIL_ON_ERROR" = true ];
8+
if [ "$CC_FAIL_ON_ERROR" = true ];
99
then
1010
say "$r Exiting...$x"
1111
exit 1;
1212
fi
1313
}
1414
lower() {
15-
echo $(echo $1 | sed 's/CODECOV//' | sed 's/_/-/g' | tr '[:upper:]' '[:lower:]')
15+
echo $(echo $1 | sed 's/CC//' | sed 's/_/-/g' | tr '[:upper:]' '[:lower:]')
1616
}
1717
k_arg() {
18-
if [ -n "$(eval echo \$"CODECOV_$1")" ];
18+
if [ -n "$(eval echo \$"CC_$1")" ];
1919
then
2020
echo "--$(lower "$1")"
2121
fi
2222
}
2323
v_arg() {
24-
if [ -n "$(eval echo \$"CODECOV_$1")" ];
24+
if [ -n "$(eval echo \$"CC_$1")" ];
2525
then
26-
echo "$(eval echo \$"CODECOV_$1")"
26+
echo "$(eval echo \$"CC_$1")"
2727
fi
2828
}
2929
write_bool_args() {
@@ -37,217 +37,217 @@ g="\033[0;32m" # info/debug
3737
r="\033[0;31m" # errors
3838
x="\033[0m"
3939
retry="--retry 5 --retry-delay 2"
40-
CODECOV_WRAPPER_VERSION="0.2.6"
41-
CODECOV_VERSION="${CODECOV_VERSION:-latest}"
42-
CODECOV_FAIL_ON_ERROR="${CODECOV_FAIL_ON_ERROR:-false}"
43-
CODECOV_RUN_CMD="${CODECOV_RUN_CMD:-upload-coverage}"
44-
CODECOV_CLI_TYPE=${CODECOV_CLI_TYPE:-"codecov-cli"}
40+
CC_WRAPPER_VERSION="0.2.7"
41+
CC_VERSION="${CC_VERSION:-latest}"
42+
CC_FAIL_ON_ERROR="${CC_FAIL_ON_ERROR:-false}"
43+
CC_RUN_CMD="${CC_RUN_CMD:-upload-coverage}"
44+
CC_CLI_TYPE=${CC_CLI_TYPE:-"codecov-cli"}
4545
say " _____ _
4646
/ ____| | |
4747
| | ___ __| | ___ ___ _____ __
4848
| | / _ \\ / _\` |/ _ \\/ __/ _ \\ \\ / /
4949
| |___| (_) | (_| | __/ (_| (_) \\ V /
5050
\\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/
51-
$r Wrapper-$CODECOV_WRAPPER_VERSION$x
51+
$r Wrapper-$CC_WRAPPER_VERSION$x
5252
"
53-
if [[ "$CODECOV_CLI_TYPE" != "codecov-cli" && "$CODECOV_CLI_TYPE" != "sentry-prevent-cli" ]]; then
54-
echo "Invalid CODECOV_CLI_TYPE: '$CODECOV_CLI_TYPE'. Must be 'codecov-cli' or 'sentry-prevent-cli'"
53+
if [[ "$CC_CLI_TYPE" != "codecov-cli" && "$CC_CLI_TYPE" != "sentry-prevent-cli" ]]; then
54+
echo "Invalid CC_CLI_TYPE: '$CC_CLI_TYPE'. Must be 'codecov-cli' or 'sentry-prevent-cli'"
5555
exit 1
5656
fi
57-
if [ -n "$CODECOV_BINARY" ];
57+
if [ -n "$CC_BINARY" ];
5858
then
59-
if [ -f "$CODECOV_BINARY" ];
59+
if [ -f "$CC_BINARY" ];
6060
then
61-
CODECOV_FILENAME=$CODECOV_BINARY
62-
CODECOV_COMMAND=$CODECOV_BINARY
61+
CC_FILENAME=$CC_BINARY
62+
CC_COMMAND=$CC_BINARY
6363
else
64-
exit_if_error "Could not find binary file $CODECOV_BINARY"
64+
exit_if_error "Could not find binary file $CC_BINARY"
6565
fi
66-
elif [ "$CODECOV_USE_PYPI" == "true" ];
66+
elif [ "$CC_USE_PYPI" == "true" ];
6767
then
68-
if ! pip install "${CODECOV_CLI_TYPE}$([ "$CODECOV_VERSION" == "latest" ] && echo "" || echo "==$CODECOV_VERSION")"; then
68+
if ! pip install "${CC_CLI_TYPE}$([ "$CC_VERSION" == "latest" ] && echo "" || echo "==$CC_VERSION")"; then
6969
exit_if_error "Could not install via pypi."
7070
exit
7171
fi
72-
CODECOV_COMMAND="${CODECOV_CLI_TYPE}"
72+
CC_COMMAND="${CC_CLI_TYPE}"
7373
else
74-
if [ -n "$CODECOV_OS" ];
74+
if [ -n "$CC_OS" ];
7575
then
76-
say "$g==>$x Overridden OS: $b${CODECOV_OS}$x"
76+
say "$g==>$x Overridden OS: $b${CC_OS}$x"
7777
else
78-
CODECOV_OS="windows"
78+
CC_OS="windows"
7979
family=$(uname -s | tr '[:upper:]' '[:lower:]')
80-
[[ $family == "darwin" ]] && CODECOV_OS="macos"
81-
[[ $family == "linux" ]] && CODECOV_OS="linux"
82-
[[ $CODECOV_OS == "linux" ]] && \
80+
[[ $family == "darwin" ]] && CC_OS="macos"
81+
[[ $family == "linux" ]] && CC_OS="linux"
82+
[[ $CC_OS == "linux" ]] && \
8383
osID=$(grep -e "^ID=" /etc/os-release | cut -c4-)
84-
[[ $osID == "alpine" ]] && CODECOV_OS="alpine"
85-
[[ $(arch) == "aarch64" && $family == "linux" ]] && CODECOV_OS+="-arm64"
86-
say "$g==>$x Detected $b${CODECOV_OS}$x"
84+
[[ $osID == "alpine" ]] && CC_OS="alpine"
85+
[[ $(arch) == "aarch64" && $family == "linux" ]] && CC_OS+="-arm64"
86+
say "$g==>$x Detected $b${CC_OS}$x"
8787
fi
88-
CODECOV_FILENAME="${CODECOV_CLI_TYPE%-cli}"
89-
[[ $CODECOV_OS == "windows" ]] && CODECOV_FILENAME+=".exe"
90-
CODECOV_COMMAND="./$CODECOV_FILENAME"
91-
[[ $CODECOV_OS == "macos" ]] && \
88+
CC_FILENAME="${CC_CLI_TYPE%-cli}"
89+
[[ $CC_OS == "windows" ]] && CC_FILENAME+=".exe"
90+
CC_COMMAND="./$CC_FILENAME"
91+
[[ $CC_OS == "macos" ]] && \
9292
! command -v gpg 2>&1 >/dev/null && \
9393
HOMEBREW_NO_AUTO_UPDATE=1 brew install gpg
94-
CODECOV_URL="${CODECOV_CLI_URL:-https://cli.codecov.io}"
95-
CODECOV_URL="$CODECOV_URL/${CODECOV_VERSION}"
96-
CODECOV_URL="$CODECOV_URL/${CODECOV_OS}/${CODECOV_FILENAME}"
97-
say "$g ->$x Downloading $b${CODECOV_URL}$x"
98-
curl -O $retry "$CODECOV_URL"
99-
say "$g==>$x Finishing downloading $b${CODECOV_OS}:${CODECOV_VERSION}$x"
100-
v_url="https://cli.codecov.io/api/${CODECOV_OS}/${CODECOV_VERSION}"
94+
CC_URL="${CC_CLI_URL:-https://cli.codecov.io}"
95+
CC_URL="$CC_URL/${CC_VERSION}"
96+
CC_URL="$CC_URL/${CC_OS}/${CC_FILENAME}"
97+
say "$g ->$x Downloading $b${CC_URL}$x"
98+
curl -O $retry "$CC_URL"
99+
say "$g==>$x Finishing downloading $b${CC_OS}:${CC_VERSION}$x"
100+
v_url="https://cli.codecov.io/api/${CC_OS}/${CC_VERSION}"
101101
v=$(curl $retry --retry-all-errors -s "$v_url" -H "Accept:application/json" | tr \{ '\n' | tr , '\n' | tr \} '\n' | grep "\"version\"" | awk -F'"' '{print $4}' | tail -1)
102102
say " Version: $b$v$x"
103103
say " "
104104
fi
105-
if [ "$CODECOV_SKIP_VALIDATION" == "true" ] || [ -n "$CODECOV_BINARY" ] || [ "$CODECOV_USE_PYPI" == "true" ];
105+
if [ "$CC_SKIP_VALIDATION" == "true" ] || [ -n "$CC_BINARY" ] || [ "$CC_USE_PYPI" == "true" ];
106106
then
107107
say "$r==>$x Bypassing validation..."
108-
if [ "$CODECOV_SKIP_VALIDATION" == "true" ];
108+
if [ "$CC_SKIP_VALIDATION" == "true" ];
109109
then
110-
chmod +x "$CODECOV_COMMAND"
110+
chmod +x "$CC_COMMAND"
111111
fi
112112
else
113113
echo "$(curl -s https://keybase.io/codecovsecurity/pgp_keys.asc)" | \
114114
gpg --no-default-keyring --import
115115
# One-time step
116116
say "$g==>$x Verifying GPG signature integrity"
117117
sha_url="https://cli.codecov.io"
118-
sha_url="${sha_url}/${CODECOV_VERSION}/${CODECOV_OS}"
119-
sha_url="${sha_url}/${CODECOV_FILENAME}.SHA256SUM"
118+
sha_url="${sha_url}/${CC_VERSION}/${CC_OS}"
119+
sha_url="${sha_url}/${CC_FILENAME}.SHA256SUM"
120120
say "$g ->$x Downloading $b${sha_url}$x"
121121
say "$g ->$x Downloading $b${sha_url}.sig$x"
122122
say " "
123123
curl -Os $retry --connect-timeout 2 "$sha_url"
124124
curl -Os $retry --connect-timeout 2 "${sha_url}.sig"
125-
if ! gpg --verify "${CODECOV_FILENAME}.SHA256SUM.sig" "${CODECOV_FILENAME}.SHA256SUM";
125+
if ! gpg --verify "${CC_FILENAME}.SHA256SUM.sig" "${CC_FILENAME}.SHA256SUM";
126126
then
127127
exit_if_error "Could not verify signature. Please contact Codecov if problem continues"
128128
fi
129-
if ! (shasum -a 256 -c "${CODECOV_FILENAME}.SHA256SUM" 2>/dev/null || \
130-
sha256sum -c "${CODECOV_FILENAME}.SHA256SUM");
129+
if ! (shasum -a 256 -c "${CC_FILENAME}.SHA256SUM" 2>/dev/null || \
130+
sha256sum -c "${CC_FILENAME}.SHA256SUM");
131131
then
132132
exit_if_error "Could not verify SHASUM. Please contact Codecov if problem continues"
133133
fi
134134
say "$g==>$x CLI integrity verified"
135135
say
136-
chmod +x "$CODECOV_COMMAND"
136+
chmod +x "$CC_COMMAND"
137137
fi
138-
if [ -n "$CODECOV_BINARY_LOCATION" ];
138+
if [ -n "$CC_BINARY_LOCATION" ];
139139
then
140-
mkdir -p "$CODECOV_BINARY_LOCATION" && mv "$CODECOV_FILENAME" $_
141-
say "$g==>$x ${CODECOV_CLI_TYPE} binary moved to ${CODECOV_BINARY_LOCATION}"
140+
mkdir -p "$CC_BINARY_LOCATION" && mv "$CC_FILENAME" $_
141+
say "$g==>$x ${CC_CLI_TYPE} binary moved to ${CC_BINARY_LOCATION}"
142142
fi
143-
if [ "$CODECOV_DOWNLOAD_ONLY" = "true" ];
143+
if [ "$CC_DOWNLOAD_ONLY" = "true" ];
144144
then
145-
say "$g==>$x ${CODECOV_CLI_TYPE} download only called. Exiting..."
145+
say "$g==>$x ${CC_CLI_TYPE} download only called. Exiting..."
146146
exit
147147
fi
148-
CODECOV_CLI_ARGS=()
149-
CODECOV_CLI_ARGS+=( $(k_arg AUTO_LOAD_PARAMS_FROM) $(v_arg AUTO_LOAD_PARAMS_FROM))
150-
CODECOV_CLI_ARGS+=( $(k_arg ENTERPRISE_URL) $(v_arg ENTERPRISE_URL))
151-
if [ -n "$CODECOV_YML_PATH" ]
148+
CC_CLI_ARGS=()
149+
CC_CLI_ARGS+=( $(k_arg AUTO_LOAD_PARAMS_FROM) $(v_arg AUTO_LOAD_PARAMS_FROM))
150+
CC_CLI_ARGS+=( $(k_arg ENTERPRISE_URL) $(v_arg ENTERPRISE_URL))
151+
if [ -n "$CC_YML_PATH" ]
152152
then
153-
CODECOV_CLI_ARGS+=( "--codecov-yml-path" )
154-
CODECOV_CLI_ARGS+=( "$CODECOV_YML_PATH" )
153+
CC_CLI_ARGS+=( "--codecov-yml-path" )
154+
CC_CLI_ARGS+=( "$CC_YML_PATH" )
155155
fi
156-
CODECOV_CLI_ARGS+=( $(write_bool_args CODECOV_DISABLE_TELEM) )
157-
CODECOV_CLI_ARGS+=( $(write_bool_args CODECOV_VERBOSE) )
158-
CODECOV_ARGS=()
159-
if [ "$CODECOV_RUN_CMD" == "upload-coverage" ]; then
156+
CC_CLI_ARGS+=( $(write_bool_args CC_DISABLE_TELEM) )
157+
CC_CLI_ARGS+=( $(write_bool_args CC_VERBOSE) )
158+
CC_ARGS=()
159+
if [ "$CC_RUN_CMD" == "upload-coverage" ]; then
160160
# Args for create commit
161-
CODECOV_ARGS+=( $(write_bool_args CODECOV_FAIL_ON_ERROR) )
162-
CODECOV_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
163-
CODECOV_ARGS+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
164-
CODECOV_ARGS+=( $(k_arg PR) $(v_arg PR))
165-
CODECOV_ARGS+=( $(k_arg SHA) $(v_arg SHA))
166-
CODECOV_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
161+
CC_ARGS+=( $(write_bool_args CC_FAIL_ON_ERROR) )
162+
CC_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
163+
CC_ARGS+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
164+
CC_ARGS+=( $(k_arg PR) $(v_arg PR))
165+
CC_ARGS+=( $(k_arg SHA) $(v_arg SHA))
166+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
167167
# Args for create report
168-
CODECOV_ARGS+=( $(k_arg CODE) $(v_arg CODE))
168+
CC_ARGS+=( $(k_arg CODE) $(v_arg CODE))
169169
# Args for do upload
170-
CODECOV_ARGS+=( $(k_arg ENV) $(v_arg ENV))
170+
CC_ARGS+=( $(k_arg ENV) $(v_arg ENV))
171171
OLDIFS=$IFS;IFS=,
172-
CODECOV_ARGS+=( $(k_arg BRANCH) $(v_arg BRANCH))
173-
CODECOV_ARGS+=( $(k_arg BUILD) $(v_arg BUILD))
174-
CODECOV_ARGS+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL))
175-
CODECOV_ARGS+=( $(k_arg DIR) $(v_arg DIR))
176-
CODECOV_ARGS+=( $(write_bool_args CODECOV_DISABLE_FILE_FIXES) )
177-
CODECOV_ARGS+=( $(write_bool_args CODECOV_DISABLE_SEARCH) )
178-
CODECOV_ARGS+=( $(write_bool_args CODECOV_DRY_RUN) )
179-
if [ -n "$CODECOV_EXCLUDES" ];
172+
CC_ARGS+=( $(k_arg BRANCH) $(v_arg BRANCH))
173+
CC_ARGS+=( $(k_arg BUILD) $(v_arg BUILD))
174+
CC_ARGS+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL))
175+
CC_ARGS+=( $(k_arg DIR) $(v_arg DIR))
176+
CC_ARGS+=( $(write_bool_args CC_DISABLE_FILE_FIXES) )
177+
CC_ARGS+=( $(write_bool_args CC_DISABLE_SEARCH) )
178+
CC_ARGS+=( $(write_bool_args CC_DRY_RUN) )
179+
if [ -n "$CC_EXCLUDES" ];
180180
then
181-
for directory in $CODECOV_EXCLUDES; do
182-
CODECOV_ARGS+=( "--exclude" "$directory" )
181+
for directory in $CC_EXCLUDES; do
182+
CC_ARGS+=( "--exclude" "$directory" )
183183
done
184184
fi
185-
if [ -n "$CODECOV_FILES" ];
185+
if [ -n "$CC_FILES" ];
186186
then
187-
for file in $CODECOV_FILES; do
188-
CODECOV_ARGS+=( "--file" "$file" )
187+
for file in $CC_FILES; do
188+
CC_ARGS+=( "--file" "$file" )
189189
done
190190
fi
191-
if [ -n "$CODECOV_FLAGS" ];
191+
if [ -n "$CC_FLAGS" ];
192192
then
193-
for flag in $CODECOV_FLAGS; do
194-
CODECOV_ARGS+=( "--flag" "$flag" )
193+
for flag in $CC_FLAGS; do
194+
CC_ARGS+=( "--flag" "$flag" )
195195
done
196196
fi
197-
CODECOV_ARGS+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS))
198-
CODECOV_ARGS+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE))
199-
CODECOV_ARGS+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE))
200-
CODECOV_ARGS+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE))
201-
CODECOV_ARGS+=( $(write_bool_args CODECOV_HANDLE_NO_REPORTS_FOUND) )
202-
CODECOV_ARGS+=( $(write_bool_args CODECOV_RECURSE_SUBMODULES) )
203-
CODECOV_ARGS+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE))
204-
CODECOV_ARGS+=( $(write_bool_args CODECOV_LEGACY) )
205-
if [ -n "$CODECOV_NAME" ];
197+
CC_ARGS+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS))
198+
CC_ARGS+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE))
199+
CC_ARGS+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE))
200+
CC_ARGS+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE))
201+
CC_ARGS+=( $(write_bool_args CC_HANDLE_NO_REPORTS_FOUND) )
202+
CC_ARGS+=( $(write_bool_args CC_RECURSE_SUBMODULES) )
203+
CC_ARGS+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE))
204+
CC_ARGS+=( $(write_bool_args CC_LEGACY) )
205+
if [ -n "$CC_NAME" ];
206206
then
207-
CODECOV_ARGS+=( "--name" "$CODECOV_NAME" )
207+
CC_ARGS+=( "--name" "$CC_NAME" )
208208
fi
209-
CODECOV_ARGS+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER))
210-
CODECOV_ARGS+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX))
211-
CODECOV_ARGS+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER))
212-
if [ -n "$CODECOV_PLUGINS" ];
209+
CC_ARGS+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER))
210+
CC_ARGS+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX))
211+
CC_ARGS+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER))
212+
if [ -n "$CC_PLUGINS" ];
213213
then
214-
for plugin in $CODECOV_PLUGINS; do
215-
CODECOV_ARGS+=( "--plugin" "$plugin" )
214+
for plugin in $CC_PLUGINS; do
215+
CC_ARGS+=( "--plugin" "$plugin" )
216216
done
217217
fi
218-
CODECOV_ARGS+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE))
219-
CODECOV_ARGS+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT))
218+
CC_ARGS+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE))
219+
CC_ARGS+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT))
220220
IFS=$OLDIFS
221-
elif [ "$CODECOV_RUN_CMD" == "empty-upload" ]; then
222-
CODECOV_ARGS+=( $(k_arg BRANCH) $(v_arg BRANCH))
223-
CODECOV_ARGS+=( $(write_bool_args CODECOV_FAIL_ON_ERROR) )
224-
CODECOV_ARGS+=( $(write_bool_args CODECOV_FORCE) )
225-
CODECOV_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
226-
CODECOV_ARGS+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
227-
CODECOV_ARGS+=( $(k_arg PR) $(v_arg PR))
228-
CODECOV_ARGS+=( $(k_arg SHA) $(v_arg SHA))
229-
CODECOV_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
230-
elif [ "$CODECOV_RUN_CMD" == "pr-base-picking" ]; then
231-
CODECOV_ARGS+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA))
232-
CODECOV_ARGS+=( $(k_arg PR) $(v_arg PR))
233-
CODECOV_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
234-
CODECOV_ARGS+=( $(k_arg SERVICE) $(v_arg SERVICE))
235-
elif [ "$CODECOV_RUN_CMD" == "send-notifications" ]; then
236-
CODECOV_ARGS+=( $(k_arg SHA) $(v_arg SHA))
237-
CODECOV_ARGS+=( $(write_bool_args CODECOV_FAIL_ON_ERROR) )
238-
CODECOV_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
239-
CODECOV_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
221+
elif [ "$CC_RUN_CMD" == "empty-upload" ]; then
222+
CC_ARGS+=( $(k_arg BRANCH) $(v_arg BRANCH))
223+
CC_ARGS+=( $(write_bool_args CC_FAIL_ON_ERROR) )
224+
CC_ARGS+=( $(write_bool_args CC_FORCE) )
225+
CC_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
226+
CC_ARGS+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA))
227+
CC_ARGS+=( $(k_arg PR) $(v_arg PR))
228+
CC_ARGS+=( $(k_arg SHA) $(v_arg SHA))
229+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
230+
elif [ "$CC_RUN_CMD" == "pr-base-picking" ]; then
231+
CC_ARGS+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA))
232+
CC_ARGS+=( $(k_arg PR) $(v_arg PR))
233+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
234+
CC_ARGS+=( $(k_arg SERVICE) $(v_arg SERVICE))
235+
elif [ "$CC_RUN_CMD" == "send-notifications" ]; then
236+
CC_ARGS+=( $(k_arg SHA) $(v_arg SHA))
237+
CC_ARGS+=( $(write_bool_args CC_FAIL_ON_ERROR) )
238+
CC_ARGS+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
239+
CC_ARGS+=( $(k_arg SLUG) $(v_arg SLUG))
240240
else
241-
exit_if_error "Invalid run command specified: $CODECOV_RUN_CMD"
241+
exit_if_error "Invalid run command specified: $CC_RUN_CMD"
242242
exit
243243
fi
244244
unset NODE_OPTIONS
245245
# github.com/codecov/uploader/issues/475
246-
if [ -n "$CODECOV_TOKEN_VAR" ];
246+
if [ -n "$CC_TOKEN_VAR" ];
247247
then
248-
token="$(eval echo \$$CODECOV_TOKEN_VAR)"
248+
token="$(eval echo \$$CC_TOKEN_VAR)"
249249
else
250-
token="$(eval echo $CODECOV_TOKEN)"
250+
token="$(eval echo $CC_TOKEN)"
251251
fi
252252
say "$g ->$x Token length: ${#token}"
253253
token_str=""
@@ -257,13 +257,13 @@ then
257257
token_str+=" -t <redacted>"
258258
token_arg+=( " -t " "$token")
259259
fi
260-
say "$g==>$x Running $CODECOV_RUN_CMD"
261-
say " $b$CODECOV_COMMAND $(echo "${CODECOV_CLI_ARGS[@]}") $CODECOV_RUN_CMD$token_str $(echo "${CODECOV_ARGS[@]}")$x"
262-
if ! $CODECOV_COMMAND \
263-
${CODECOV_CLI_ARGS[*]} \
264-
${CODECOV_RUN_CMD} \
260+
say "$g==>$x Running $CC_RUN_CMD"
261+
say " $b$CC_COMMAND $(echo "${CC_CLI_ARGS[@]}") $CC_RUN_CMD$token_str $(echo "${CC_ARGS[@]}")$x"
262+
if ! $CC_COMMAND \
263+
${CC_CLI_ARGS[*]} \
264+
${CC_RUN_CMD} \
265265
${token_arg[*]} \
266-
"${CODECOV_ARGS[@]}";
266+
"${CC_ARGS[@]}";
267267
then
268-
exit_if_error "Failed to run $CODECOV_RUN_CMD"
268+
exit_if_error "Failed to run $CC_RUN_CMD"
269269
fi

0 commit comments

Comments
 (0)