From 063140d7d5d16b96110a4079ca4d98e464586cda Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Sat, 18 Jan 2025 21:26:15 -0300 Subject: [PATCH] feat: add new commands for CLI usage --- dist/codecov.sh | 128 +++++++++++++++---------- env | 4 + scripts/run.sh | 4 +- scripts/run_command.sh | 27 ++++++ scripts/set_defaults.sh | 1 + scripts/set_empty_upload_args.sh | 9 ++ scripts/set_pr_base_picking_args.sh | 8 ++ scripts/set_send_notifications_args.sh | 8 ++ scripts/set_token.sh | 17 ++++ scripts/set_upload_coverage_args.sh | 66 ++++++------- scripts/upload.sh | 33 ------- 11 files changed, 184 insertions(+), 121 deletions(-) create mode 100755 scripts/run_command.sh create mode 100755 scripts/set_empty_upload_args.sh create mode 100755 scripts/set_pr_base_picking_args.sh create mode 100755 scripts/set_send_notifications_args.sh create mode 100755 scripts/set_token.sh delete mode 100755 scripts/upload.sh diff --git a/dist/codecov.sh b/dist/codecov.sh index 224d6ce..ffc65b5 100755 --- a/dist/codecov.sh +++ b/dist/codecov.sh @@ -47,6 +47,7 @@ say " _____ _ " CC_VERSION="${CC_VERSION:-latest}" CC_FAIL_ON_ERROR="${CC_FAIL_ON_ERROR:-false}" +CC_RUN_COMMAND="${CC_RUN_COMMAND:-upload-coverage}" if [ -n "$CC_BINARY" ]; then if [ -f "$CC_BINARY" ]; @@ -136,91 +137,112 @@ then fi cc_cli_args+=( $(write_truthy_args CC_DISABLE_TELEM) ) cc_cli_args+=( $(write_truthy_args CC_VERBOSE) ) -cc_uc_args=() +if [ -n "$CC_TOKEN_VAR" ]; +then + token="$(eval echo \$$CC_TOKEN_VAR)" +else + token="$(eval echo $CC_TOKEN)" +fi +say "$g ->$x Token of length ${#token} detected" +token_str="" +token_arg=() +if [ -n "$token" ]; +then + token_str+=" -t " + token_arg+=( " -t " "$token") +fi +if [ "$CC_RUN_COMMAND" == "upload-coverage" ]; then +cc_run_args=() # Args for create commit -cc_uc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) -cc_uc_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) -cc_uc_args+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA)) -cc_uc_args+=( $(k_arg PR) $(v_arg PR)) -cc_uc_args+=( $(k_arg SHA) $(v_arg SHA)) -cc_uc_args+=( $(k_arg SLUG) $(v_arg SLUG)) +cc_run_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +cc_run_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) +cc_run_args+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA)) +cc_run_args+=( $(k_arg PR) $(v_arg PR)) +cc_run_args+=( $(k_arg SHA) $(v_arg SHA)) +cc_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) # Args for create report -cc_uc_args+=( $(k_arg CODE) $(v_arg CODE)) +cc_run_args+=( $(k_arg CODE) $(v_arg CODE)) # Args for do upload -cc_uc_args+=( $(k_arg ENV) $(v_arg ENV)) +cc_run_args+=( $(k_arg ENV) $(v_arg ENV)) OLDIFS=$IFS;IFS=, -cc_uc_args+=( $(k_arg BRANCH) $(v_arg BRANCH)) -cc_uc_args+=( $(k_arg BUILD) $(v_arg BUILD)) -cc_uc_args+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL)) -cc_uc_args+=( $(k_arg DIR) $(v_arg DIR)) -cc_uc_args+=( $(write_truthy_args CC_DISABLE_FILE_FIXES) ) -cc_uc_args+=( $(write_truthy_args CC_DISABLE_SEARCH) ) -cc_uc_args+=( $(write_truthy_args CC_DRY_RUN) ) +cc_run_args+=( $(k_arg BRANCH) $(v_arg BRANCH)) +cc_run_args+=( $(k_arg BUILD) $(v_arg BUILD)) +cc_run_args+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL)) +cc_run_args+=( $(k_arg DIR) $(v_arg DIR)) +cc_run_args+=( $(write_truthy_args CC_DISABLE_FILE_FIXES) ) +cc_run_args+=( $(write_truthy_args CC_DISABLE_SEARCH) ) +cc_run_args+=( $(write_truthy_args CC_DRY_RUN) ) if [ -n "$CC_EXCLUDES" ]; then for directory in $CC_EXCLUDES; do - cc_uc_args+=( "--exclude" "$directory" ) + cc_run_args+=( "--exclude" "$directory" ) done fi if [ -n "$CC_FILES" ]; then for file in $CC_FILES; do - cc_uc_args+=( "--file" "$file" ) + cc_run_args+=( "--file" "$file" ) done fi if [ -n "$CC_FLAGS" ]; then for flag in $CC_FLAGS; do - cc_uc_args+=( "--flag" "$flag" ) + cc_run_args+=( "--flag" "$flag" ) done fi -cc_uc_args+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS)) -cc_uc_args+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE)) -cc_uc_args+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE)) -cc_uc_args+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE)) -cc_uc_args+=( $(write_truthy_args CC_HANDLE_NO_REPORTS_FOUND) ) -cc_uc_args+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE)) -cc_uc_args+=( $(write_truthy_args CC_LEGACY) ) +cc_run_args+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS)) +cc_run_args+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE)) +cc_run_args+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE)) +cc_run_args+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE)) +cc_run_args+=( $(write_truthy_args CC_HANDLE_NO_REPORTS_FOUND) ) +cc_run_args+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE)) +cc_run_args+=( $(write_truthy_args CC_LEGACY) ) if [ -n "$CC_NAME" ]; then - cc_uc_args+=( "--name" "$CC_NAME" ) + cc_run_args+=( "--name" "$CC_NAME" ) fi -cc_uc_args+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER)) -cc_uc_args+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX)) -cc_uc_args+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER)) +cc_run_args+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER)) +cc_run_args+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX)) +cc_run_args+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER)) if [ -n "$CC_PLUGINS" ]; then for plugin in $CC_PLUGINS; do - cc_uc_args+=( "--plugin" "$plugin" ) + cc_run_args+=( "--plugin" "$plugin" ) done fi -cc_uc_args+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE)) -cc_uc_args+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT)) +cc_run_args+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE)) +cc_run_args+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT)) IFS=$OLDIFS +elif [ "$CC_RUN_COMMAND" == "empty-upload" ]; then +cc_run_args=() +cc_run_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +cc_run_args+=( $(write_truthy_args CC_FORCE) ) +cc_run_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) +cc_run_args+=( $(k_arg SHA) $(v_arg SHA)) +cc_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) +elif [ "$CC_RUN_COMMAND" == "pr-base-picking" ]; then +cc_run_args=() +cc_run_args+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA)) +cc_run_args+=( $(k_arg PR) $(v_arg PR)) +cc_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) +cc_run_args+=( $(k_arg SERVICE) $(v_arg SERVICE)) +elif [ "$CC_RUN_COMMAND" == "send-notifications" ]; then +cc_run_args=() +cc_run_args+=( $(k_arg SHA) $(v_arg SHA)) +cc_run_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +cc_run_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) +cc_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) +fi unset NODE_OPTIONS # See https://github.com/codecov/uploader/issues/475 -chmod +x $cc_command -if [ -n "$CC_TOKEN_VAR" ]; -then - token="$(eval echo \$$CC_TOKEN_VAR)" -else - token="$(eval echo $CC_TOKEN)" -fi -say "$g ->$x Token of length ${#token} detected" -token_str="" -token_arg=() -if [ -n "$token" ]; -then - token_str+=" -t " - token_arg+=( " -t " "$token") -fi -say "$g==>$x Running upload-coverage" -say " $b$cc_command $(echo "${cc_cli_args[@]}") upload-coverage$token_str $(echo "${cc_uc_args[@]}")$x" +chmod +x "$cc_command" +say "$g==>$x Running $CC_RUN_COMMAND" +say " $b$cc_command $(echo "${cc_cli_args[@]}")$CC_RUN_COMMAND$token_str $(echo "${cc_run_args[@]}")$x" if ! $cc_command \ ${cc_cli_args[*]} \ - upload-coverage \ + ${CC_RUN_COMMAND} \ ${token_arg[*]} \ - "${cc_uc_args[@]}"; + "${cc_run_args[@]}"; then - exit_if_error "Failed to upload coverage" + exit_if_error "Failed to run $CC_RUN_COMMAND" fi diff --git a/env b/env index bf95c41..6043ab9 100644 --- a/env +++ b/env @@ -1,5 +1,6 @@ CC_AUTO_LOAD_PARAMS_FROM +CC_BASE_SHA CC_BINARY CC_BINARY_LOCATION CC_BRANCH @@ -18,6 +19,7 @@ CC_EXCLUDES CC_FAIL_ON_ERROR CC_FILES CC_FLAGS +CC_FORCE CC_GCOV_ARGS CC_GCOV_EXECUTABLE CC_GCOV_IGNORE @@ -36,6 +38,8 @@ CC_PLUGINS CC_PR CC_PUBLIC_PGP_KEY CC_REPORT_TYPE +CC_RUN_COMMAND +CC_SERVICE CC_SHA CC_SKIP_VALIDATION CC_SLUG diff --git a/scripts/run.sh b/scripts/run.sh index 5522891..065b131 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -6,5 +6,5 @@ . ./validate.sh . ./set_cli_args.sh -. ./set_upload_coverage_args.sh -. ./upload.sh +. ./set_token.sh +. ./run_command.sh diff --git a/scripts/run_command.sh b/scripts/run_command.sh new file mode 100755 index 0000000..5ffe111 --- /dev/null +++ b/scripts/run_command.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +if [ "$CODECOV_RUN_COMMAND" == "upload-coverage" ]; then + . ./set_upload_coverage_args.sh +elif [ "$CODECOV_RUN_COMMAND" == "empty-upload" ]; then + . ./set_empty_upload_args.sh +elif [ "$CODECOV_RUN_COMMAND" == "pr-base-picking" ]; then + . ./set_pr_base_picking_args.sh +elif [ "$CODECOV_RUN_COMMAND" == "send-notifications" ]; then + . ./set_send_notifications_args.sh +fi + +unset NODE_OPTIONS +# See https://github.com/codecov/uploader/issues/475 + +chmod +x "$codecov_command" + +say "$g==>$x Running $CODECOV_RUN_COMMAND" +say " $b$codecov_command $(echo "${codecov_cli_args[@]}")$CODECOV_RUN_COMMAND$token_str $(echo "${codecov_run_args[@]}")$x" +if ! $codecov_command \ + ${codecov_cli_args[*]} \ + ${CODECOV_RUN_COMMAND} \ + ${token_arg[*]} \ + "${codecov_run_args[@]}"; +then + exit_if_error "Failed to run $CODECOV_RUN_COMMAND" +fi diff --git a/scripts/set_defaults.sh b/scripts/set_defaults.sh index a8c5bd1..614ca28 100755 --- a/scripts/set_defaults.sh +++ b/scripts/set_defaults.sh @@ -55,3 +55,4 @@ say " _____ _ CODECOV_VERSION="${CODECOV_VERSION:-latest}" CODECOV_FAIL_ON_ERROR="${CODECOV_FAIL_ON_ERROR:-false}" +CODECOV_RUN_COMMAND="${CODECOV_RUN_COMMAND:-upload-coverage}" diff --git a/scripts/set_empty_upload_args.sh b/scripts/set_empty_upload_args.sh new file mode 100755 index 0000000..4a476db --- /dev/null +++ b/scripts/set_empty_upload_args.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +codecov_run_args=() + +codecov_run_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) +codecov_run_args+=( $(write_truthy_args CODECOV_FORCE) ) +codecov_run_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) +codecov_run_args+=( $(k_arg SHA) $(v_arg SHA)) +codecov_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) diff --git a/scripts/set_pr_base_picking_args.sh b/scripts/set_pr_base_picking_args.sh new file mode 100755 index 0000000..29a81d0 --- /dev/null +++ b/scripts/set_pr_base_picking_args.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +codecov_run_args=() + +codecov_run_args+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA)) +codecov_run_args+=( $(k_arg PR) $(v_arg PR)) +codecov_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) +codecov_run_args+=( $(k_arg SERVICE) $(v_arg SERVICE)) diff --git a/scripts/set_send_notifications_args.sh b/scripts/set_send_notifications_args.sh new file mode 100755 index 0000000..2382219 --- /dev/null +++ b/scripts/set_send_notifications_args.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +codecov_run_args=() + +codecov_run_args+=( $(k_arg SHA) $(v_arg SHA)) +codecov_run_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) +codecov_run_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) +codecov_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) diff --git a/scripts/set_token.sh b/scripts/set_token.sh new file mode 100755 index 0000000..47759ee --- /dev/null +++ b/scripts/set_token.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if [ -n "$CODECOV_TOKEN_VAR" ]; +then + token="$(eval echo \$$CODECOV_TOKEN_VAR)" +else + token="$(eval echo $CODECOV_TOKEN)" +fi + +say "$g ->$x Token of length ${#token} detected" +token_str="" +token_arg=() +if [ -n "$token" ]; +then + token_str+=" -t " + token_arg+=( " -t " "$token") +fi diff --git a/scripts/set_upload_coverage_args.sh b/scripts/set_upload_coverage_args.sh index 510fdbd..1719b46 100755 --- a/scripts/set_upload_coverage_args.sh +++ b/scripts/set_upload_coverage_args.sh @@ -1,75 +1,75 @@ #!/usr/bin/env bash -codecov_uc_args=() +codecov_run_args=() # Args for create commit -codecov_uc_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) -codecov_uc_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) -codecov_uc_args+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA)) -codecov_uc_args+=( $(k_arg PR) $(v_arg PR)) -codecov_uc_args+=( $(k_arg SHA) $(v_arg SHA)) -codecov_uc_args+=( $(k_arg SLUG) $(v_arg SLUG)) +codecov_run_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) +codecov_run_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE)) +codecov_run_args+=( $(k_arg PARENT_SHA) $(v_arg PARENT_SHA)) +codecov_run_args+=( $(k_arg PR) $(v_arg PR)) +codecov_run_args+=( $(k_arg SHA) $(v_arg SHA)) +codecov_run_args+=( $(k_arg SLUG) $(v_arg SLUG)) # Args for create report -codecov_uc_args+=( $(k_arg CODE) $(v_arg CODE)) +codecov_run_args+=( $(k_arg CODE) $(v_arg CODE)) # Args for do upload -codecov_uc_args+=( $(k_arg ENV) $(v_arg ENV)) +codecov_run_args+=( $(k_arg ENV) $(v_arg ENV)) OLDIFS=$IFS;IFS=, -codecov_uc_args+=( $(k_arg BRANCH) $(v_arg BRANCH)) -codecov_uc_args+=( $(k_arg BUILD) $(v_arg BUILD)) -codecov_uc_args+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL)) -codecov_uc_args+=( $(k_arg DIR) $(v_arg DIR)) -codecov_uc_args+=( $(write_truthy_args CODECOV_DISABLE_FILE_FIXES) ) -codecov_uc_args+=( $(write_truthy_args CODECOV_DISABLE_SEARCH) ) -codecov_uc_args+=( $(write_truthy_args CODECOV_DRY_RUN) ) +codecov_run_args+=( $(k_arg BRANCH) $(v_arg BRANCH)) +codecov_run_args+=( $(k_arg BUILD) $(v_arg BUILD)) +codecov_run_args+=( $(k_arg BUILD_URL) $(v_arg BUILD_URL)) +codecov_run_args+=( $(k_arg DIR) $(v_arg DIR)) +codecov_run_args+=( $(write_truthy_args CODECOV_DISABLE_FILE_FIXES) ) +codecov_run_args+=( $(write_truthy_args CODECOV_DISABLE_SEARCH) ) +codecov_run_args+=( $(write_truthy_args CODECOV_DRY_RUN) ) if [ -n "$CODECOV_EXCLUDES" ]; then for directory in $CODECOV_EXCLUDES; do - codecov_uc_args+=( "--exclude" "$directory" ) + codecov_run_args+=( "--exclude" "$directory" ) done fi if [ -n "$CODECOV_FILES" ]; then for file in $CODECOV_FILES; do - codecov_uc_args+=( "--file" "$file" ) + codecov_run_args+=( "--file" "$file" ) done fi if [ -n "$CODECOV_FLAGS" ]; then for flag in $CODECOV_FLAGS; do - codecov_uc_args+=( "--flag" "$flag" ) + codecov_run_args+=( "--flag" "$flag" ) done fi -codecov_uc_args+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS)) -codecov_uc_args+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE)) -codecov_uc_args+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE)) -codecov_uc_args+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE)) -codecov_uc_args+=( $(write_truthy_args CODECOV_HANDLE_NO_REPORTS_FOUND) ) -codecov_uc_args+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE)) -codecov_uc_args+=( $(write_truthy_args CODECOV_LEGACY) ) +codecov_run_args+=( $(k_arg GCOV_ARGS) $(v_arg GCOV_ARGS)) +codecov_run_args+=( $(k_arg GCOV_EXECUTABLE) $(v_arg GCOV_EXECUTABLE)) +codecov_run_args+=( $(k_arg GCOV_IGNORE) $(v_arg GCOV_IGNORE)) +codecov_run_args+=( $(k_arg GCOV_INCLUDE) $(v_arg GCOV_INCLUDE)) +codecov_run_args+=( $(write_truthy_args CODECOV_HANDLE_NO_REPORTS_FOUND) ) +codecov_run_args+=( $(k_arg JOB_CODE) $(v_arg JOB_CODE)) +codecov_run_args+=( $(write_truthy_args CODECOV_LEGACY) ) if [ -n "$CODECOV_NAME" ]; then - codecov_uc_args+=( "--name" "$CODECOV_NAME" ) + codecov_run_args+=( "--name" "$CODECOV_NAME" ) fi -codecov_uc_args+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER)) -codecov_uc_args+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX)) -codecov_uc_args+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER)) +codecov_run_args+=( $(k_arg NETWORK_FILTER) $(v_arg NETWORK_FILTER)) +codecov_run_args+=( $(k_arg NETWORK_PREFIX) $(v_arg NETWORK_PREFIX)) +codecov_run_args+=( $(k_arg NETWORK_ROOT_FOLDER) $(v_arg NETWORK_ROOT_FOLDER)) if [ -n "$CODECOV_PLUGINS" ]; then for plugin in $CODECOV_PLUGINS; do - codecov_uc_args+=( "--plugin" "$plugin" ) + codecov_run_args+=( "--plugin" "$plugin" ) done fi -codecov_uc_args+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE)) -codecov_uc_args+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT)) +codecov_run_args+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE)) +codecov_run_args+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT)) IFS=$OLDIFS diff --git a/scripts/upload.sh b/scripts/upload.sh deleted file mode 100755 index e86de8f..0000000 --- a/scripts/upload.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -unset NODE_OPTIONS -# See https://github.com/codecov/uploader/issues/475 - -chmod +x $codecov_command - -if [ -n "$CODECOV_TOKEN_VAR" ]; -then - token="$(eval echo \$$CODECOV_TOKEN_VAR)" -else - token="$(eval echo $CODECOV_TOKEN)" -fi - -say "$g ->$x Token of length ${#token} detected" -token_str="" -token_arg=() -if [ -n "$token" ]; -then - token_str+=" -t " - token_arg+=( " -t " "$token") -fi - -say "$g==>$x Running upload-coverage" -say " $b$codecov_command $(echo "${codecov_cli_args[@]}") upload-coverage$token_str $(echo "${codecov_uc_args[@]}")$x" -if ! $codecov_command \ - ${codecov_cli_args[*]} \ - upload-coverage \ - ${token_arg[*]} \ - "${codecov_uc_args[@]}"; -then - exit_if_error "Failed to upload coverage" -fi