Skip to content

Commit

Permalink
fix: reduce chars
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu-codecov committed Jan 23, 2025
1 parent 147f3d5 commit 559925d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
22 changes: 11 additions & 11 deletions dist/codecov.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
CC_WRAPPER_VERSION="0.0.34"
CC_WRAPPER_VERSION="0.1.0"
set +u
say() {
echo -e "$1"
Expand Down Expand Up @@ -47,7 +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}"
CC_RUN_CMD="${CC_RUN_COMMAND:-upload-coverage}"
if [ -n "$CC_BINARY" ];
then
if [ -f "$CC_BINARY" ];
Expand Down Expand Up @@ -159,7 +159,7 @@ then
token_str+=" -t <redacted>"
token_arg+=( " -t " "$token")
fi
if [ "$CC_RUN_COMMAND" == "upload-coverage" ]; then
if [ "$CC_RUN_CMD" == "upload-coverage" ]; then
cc_args=()
# Args for create commit
cc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) )
Expand Down Expand Up @@ -221,38 +221,38 @@ fi
cc_args+=( $(k_arg REPORT_TYPE) $(v_arg REPORT_TYPE))
cc_args+=( $(k_arg SWIFT_PROJECT) $(v_arg SWIFT_PROJECT))
IFS=$OLDIFS
elif [ "$CC_RUN_COMMAND" == "empty-upload" ]; then
elif [ "$CC_RUN_CMD" == "empty-upload" ]; then
cc_args=()
cc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) )
cc_args+=( $(write_truthy_args CC_FORCE) )
cc_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
cc_args+=( $(k_arg SHA) $(v_arg SHA))
cc_args+=( $(k_arg SLUG) $(v_arg SLUG))
elif [ "$CC_RUN_COMMAND" == "pr-base-picking" ]; then
elif [ "$CC_RUN_CMD" == "pr-base-picking" ]; then
cc_args=()
cc_args+=( $(k_arg BASE_SHA) $(v_arg BASE_SHA))
cc_args+=( $(k_arg PR) $(v_arg PR))
cc_args+=( $(k_arg SLUG) $(v_arg SLUG))
cc_args+=( $(k_arg SERVICE) $(v_arg SERVICE))
elif [ "$CC_RUN_COMMAND" == "send-notifications" ]; then
elif [ "$CC_RUN_CMD" == "send-notifications" ]; then
cc_args=()
cc_args+=( $(k_arg SHA) $(v_arg SHA))
cc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) )
cc_args+=( $(k_arg GIT_SERVICE) $(v_arg GIT_SERVICE))
cc_args+=( $(k_arg SLUG) $(v_arg SLUG))
else
exit_if_error "Invalid run command specified: $CC_RUN_COMMAND"
exit_if_error "Invalid run command specified: $CC_RUN_CMD"
exit
fi
unset NODE_OPTIONS
# See https://github.com/codecov/uploader/issues/475
say "$g==>$x Running $CC_RUN_COMMAND"
say " $b$cc_command $(echo "${cc_cli_args[@]}")$CC_RUN_COMMAND$token_str $(echo "${cc_args[@]}")$x"
say "$g==>$x Running $CC_RUN_CMD"
say " $b$cc_command $(echo "${cc_cli_args[@]}")$CC_RUN_CMD$token_str $(echo "${cc_args[@]}")$x"
if ! $cc_command \
${cc_cli_args[*]} \
${CC_RUN_COMMAND} \
${CC_RUN_CMD} \
${token_arg[*]} \
"${cc_args[@]}";
then
exit_if_error "Failed to run $CC_RUN_COMMAND"
exit_if_error "Failed to run $CC_RUN_CMD"
fi
2 changes: 1 addition & 1 deletion env
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CC_PLUGINS
CC_PR
CC_PUBLIC_PGP_KEY
CC_REPORT_TYPE
CC_RUN_COMMAND
CC_RUN_CMD
CC_SERVICE
CC_SHA
CC_SKIP_VALIDATION
Expand Down
18 changes: 9 additions & 9 deletions scripts/run_command.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/usr/bin/env bash

if [ "$CODECOV_RUN_COMMAND" == "upload-coverage" ]; then
if [ "$CODECOV_RUN_CMD" == "upload-coverage" ]; then
. ./set_upload_coverage_args.sh
elif [ "$CODECOV_RUN_COMMAND" == "empty-upload" ]; then
elif [ "$CODECOV_RUN_CMD" == "empty-upload" ]; then
. ./set_empty_upload_args.sh
elif [ "$CODECOV_RUN_COMMAND" == "pr-base-picking" ]; then
elif [ "$CODECOV_RUN_CMD" == "pr-base-picking" ]; then
. ./set_pr_base_picking_args.sh
elif [ "$CODECOV_RUN_COMMAND" == "send-notifications" ]; then
elif [ "$CODECOV_RUN_CMD" == "send-notifications" ]; then
. ./set_send_notifications_args.sh
else
exit_if_error "Invalid run command specified: $CODECOV_RUN_COMMAND"
exit_if_error "Invalid run command specified: $CODECOV_RUN_CMD"
exit
fi

unset NODE_OPTIONS
# See https://github.com/codecov/uploader/issues/475

say "$g==>$x Running $CODECOV_RUN_COMMAND"
say " $b$codecov_command $(echo "${codecov_cli_args[@]}")$CODECOV_RUN_COMMAND$token_str $(echo "${codecov_args[@]}")$x"
say "$g==>$x Running $CODECOV_RUN_CMD"
say " $b$codecov_command $(echo "${codecov_cli_args[@]}")$CODECOV_RUN_CMD$token_str $(echo "${codecov_args[@]}")$x"
if ! $codecov_command \
${codecov_cli_args[*]} \
${CODECOV_RUN_COMMAND} \
${CODECOV_RUN_CMD} \
${token_arg[*]} \
"${codecov_args[@]}";
then
exit_if_error "Failed to run $CODECOV_RUN_COMMAND"
exit_if_error "Failed to run $CODECOV_RUN_CMD"
fi
2 changes: 1 addition & 1 deletion scripts/set_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +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}"
CODECOV_RUN_CMD="${CODECOV_RUN_COMMAND:-upload-coverage}"
2 changes: 1 addition & 1 deletion scripts/version.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
CODECOV_WRAPPER_VERSION="0.0.34"
CODECOV_WRAPPER_VERSION="0.1.0"

0 comments on commit 559925d

Please sign in to comment.