diff --git a/bash/_common/source-and-call.sh b/bash/_common/source-and-call.sh index 680f3f0..9797345 100644 --- a/bash/_common/source-and-call.sh +++ b/bash/_common/source-and-call.sh @@ -3,10 +3,10 @@ # Script can be ONLY executed. [[ -z "$BASH" || (-n "$BASH_LINENO" && BASH_LINENO[0] -gt 0) ]] && return -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi # first parameter is source file if [[ -n "$1" && "$1" != '.' ]]; then diff --git a/bash/board/accum-stats.sh b/bash/board/accum-stats.sh index 3443730..b80a96e 100644 --- a/bash/board/accum-stats.sh +++ b/bash/board/accum-stats.sh @@ -4,10 +4,10 @@ # This is a composite script to use from a composite GitHub action. # -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -18,20 +18,20 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-curl-workflow.sh" tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh" -[[ -z "$topic_query_url" ]] && { +if [[ -z "$topic_query_url" ]]; then gh_print_error_ln "$0: error: \`topic_query_url\` variable is not defined." exit 255 -} +fi -[[ -z "$replies_sed_regexp" ]] && { +if [[ -z "$replies_sed_regexp" ]]; then gh_print_error_ln "$0: error: \`replies_sed_regexp\` variable is not defined." exit 255 -} +fi -[[ -z "$views_sed_regexp" ]] && { +if [[ -z "$views_sed_regexp" ]]; then gh_print_error_ln "$0: error: \`views_sed_regexp\` variable is not defined." exit 255 -} +fi [[ -z "$stats_by_year_dir" ]] && stats_by_year_dir="$stats_dir/by_year" [[ -z "$stats_json" ]] && stats_json="$stats_dir/latest.json" diff --git a/bash/cache/accum-content.sh b/bash/cache/accum-content.sh index 384098f..c0e2712 100644 --- a/bash/cache/accum-content.sh +++ b/bash/cache/accum-content.sh @@ -19,10 +19,10 @@ # The rest of variables is related to other scripts. # -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -38,20 +38,20 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/utils.sh" content_config_file="${content_config_file//\\//}" content_index_file="${content_index_file//\\//}" -[[ -z "$content_config_file" ]] && { +if [[ -z "$content_config_file" ]]; then gh_print_error_ln "$0: error: \`content_config_file\` variable must be defined." exit 255 -} +fi -[[ ! -f "$content_config_file" ]] && { +if [[ ! -f "$content_config_file" ]]; then gh_print_error_ln "$0: error: \`content_config_file\` file is not found: \`$content_config_file\`" exit 255 -} +fi -[[ -z "$content_index_file" ]] && { +if [[ -z "$content_index_file" ]]; then gh_print_error_ln "$0: error: \`content_index_file\` variable must be defined." exit 255 -} +fi content_index_dir="${content_index_dir%/}" diff --git a/bash/github/accum-rate-limits.sh b/bash/github/accum-rate-limits.sh index 27e84bc..bc4b4e7 100644 --- a/bash/github/accum-rate-limits.sh +++ b/bash/github/accum-rate-limits.sh @@ -4,10 +4,10 @@ # This is a composite script to use from a composite GitHub action. # -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -19,10 +19,10 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-jq-workflow.sh" tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh" -[[ -z "$stat_entity" ]] && { +if [[ -z "$stat_entity" ]]; then gh_print_error_ln "$0: error: \`stat_entity\` variable is not defined." exit 255 -} +fi [[ -z "$stats_by_year_dir" ]] && stats_by_year_dir="$stats_dir/by_year" [[ -z "$stats_json" ]] && stats_json="$stats_dir/latest.json" diff --git a/bash/github/accum-stats.sh b/bash/github/accum-stats.sh index 555100a..a86c3d8 100644 --- a/bash/github/accum-stats.sh +++ b/bash/github/accum-stats.sh @@ -4,10 +4,10 @@ # This is a composite script to use from a composite GitHub action. # -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -19,10 +19,10 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-jq-workflow.sh" tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh" -[[ -z "$stat_entity" ]] && { +if [[ -z "$stat_entity" ]]; then gh_print_error_ln "$0: error: \`stat_entity\` variable is not defined." exit 255 -} +fi stat_list_key="$stat_entity" diff --git a/bash/github/begin-print-annotation-group.sh b/bash/github/begin-print-annotation-group.sh index e3f5c0e..f727a22 100644 --- a/bash/github/begin-print-annotation-group.sh +++ b/bash/github/begin-print-annotation-group.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_BEGIN_PRINT_ANNOTATION_GROUP_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/enable-github-env-autoeval.sh b/bash/github/enable-github-env-autoeval.sh index 31fea12..30f5a02 100644 --- a/bash/github/enable-github-env-autoeval.sh +++ b/bash/github/enable-github-env-autoeval.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_ENABLE_GITHUB_ENV_AUTOEVAL_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/end-print-annotation-group.sh b/bash/github/end-print-annotation-group.sh index 8e00705..563adce 100644 --- a/bash/github/end-print-annotation-group.sh +++ b/bash/github/end-print-annotation-group.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_END_PRINT_ANNOTATION_GROUP_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/eval-from-args.sh b/bash/github/eval-from-args.sh index 9761e4a..568a88a 100644 --- a/bash/github/eval-from-args.sh +++ b/bash/github/eval-from-args.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_EVAL_FROM_ARGS_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/flush-print-annotations.sh b/bash/github/flush-print-annotations.sh index 9114692..b4a4531 100644 --- a/bash/github/flush-print-annotations.sh +++ b/bash/github/flush-print-annotations.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_FLUSH_PRINT_ANNOTATIONS_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-basic-workflow.sh b/bash/github/init-basic-workflow.sh index 7f4986d..c89b78b 100644 --- a/bash/github/init-basic-workflow.sh +++ b/bash/github/init-basic-workflow.sh @@ -44,10 +44,10 @@ SOURCE_GHWF_INIT_BASIC_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-curl-workflow.sh b/bash/github/init-curl-workflow.sh index 7eea22e..e94013c 100644 --- a/bash/github/init-curl-workflow.sh +++ b/bash/github/init-curl-workflow.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_INIT_CURL_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-diff-workflow.sh b/bash/github/init-diff-workflow.sh index 0b654ce..42fc673 100644 --- a/bash/github/init-diff-workflow.sh +++ b/bash/github/init-diff-workflow.sh @@ -5,10 +5,10 @@ SOURCE_GHWF_INIT_DIFF_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-github-workflow.sh b/bash/github/init-github-workflow.sh index 9cfa876..cf36418 100644 --- a/bash/github/init-github-workflow.sh +++ b/bash/github/init-github-workflow.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_INIT_GITHUB_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-jq-workflow.sh b/bash/github/init-jq-workflow.sh index 2c1686e..e10dec8 100644 --- a/bash/github/init-jq-workflow.sh +++ b/bash/github/init-jq-workflow.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_INIT_JQ_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-print-workflow.sh b/bash/github/init-print-workflow.sh index 594e30b..a0c1ca7 100644 --- a/bash/github/init-print-workflow.sh +++ b/bash/github/init-print-workflow.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_INIT_PRINT_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-stats-workflow.sh b/bash/github/init-stats-workflow.sh index f9d0aed..4d2faec 100644 --- a/bash/github/init-stats-workflow.sh +++ b/bash/github/init-stats-workflow.sh @@ -9,27 +9,27 @@ SOURCE_GHWF_INIT_STATS_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? -[[ -z "$stats_dir" ]] && { +if [[ -z "$stats_dir" ]]; then gh_print_error_ln "$0: error: \`stats_dir\` variable must be defined." exit 255 -} +fi -[[ ! -d "$stats_dir" ]] && { +if [[ ! -d "$stats_dir" ]]; then gh_print_error_ln "$0: error: \`stats_dir\` directory is not found: \`$stats_dir\`" exit 255 -} +fi -[[ -n "$stats_json" && ! -f "$stats_json" ]] && { +if [[ -n "$stats_json" && ! -f "$stats_json" ]]; then gh_print_error_ln "$0: error: \`stats_json\` file is not found: \`$stats_json\`" exit 255 -} +fi tkl_set_return diff --git a/bash/github/init-tacklelib-workflow.sh b/bash/github/init-tacklelib-workflow.sh index 8c2118f..4962d36 100644 --- a/bash/github/init-tacklelib-workflow.sh +++ b/bash/github/init-tacklelib-workflow.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_INIT_TACKLELIB_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-xq-workflow.sh b/bash/github/init-xq-workflow.sh index 29ba543..b5f61bb 100644 --- a/bash/github/init-xq-workflow.sh +++ b/bash/github/init-xq-workflow.sh @@ -24,10 +24,10 @@ SOURCE_GHWF_INIT_XQ_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/init-yq-workflow.sh b/bash/github/init-yq-workflow.sh index 69b0689..d6e4ab9 100644 --- a/bash/github/init-yq-workflow.sh +++ b/bash/github/init-yq-workflow.sh @@ -60,10 +60,10 @@ SOURCE_GHWF_INIT_YQ_WORKFLOW_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/is-flag-true-in-flags-expr-string.sh b/bash/github/is-flag-true-in-flags-expr-string.sh index 167fdbe..7cfaa62 100644 --- a/bash/github/is-flag-true-in-flags-expr-string.sh +++ b/bash/github/is-flag-true-in-flags-expr-string.sh @@ -8,10 +8,10 @@ SOURCE_GHWF_IS_FLAG_TRUE_IN_FLAGS_EXPR_STRING_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/print-error-ln.sh b/bash/github/print-error-ln.sh index e157187..8ae8fa0 100644 --- a/bash/github/print-error-ln.sh +++ b/bash/github/print-error-ln.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_PRINT_ERROR_LN_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/print-error.sh b/bash/github/print-error.sh index cab3ced..bdb98bb 100644 --- a/bash/github/print-error.sh +++ b/bash/github/print-error.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_PRINT_ERROR_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -239,7 +239,7 @@ function gh_print_error_and_write_to_changelog_named_text_ln() if (( ENABLE_GENERATE_CHANGELOG_FILE )); then local changelog_msg="$4" - (( ${#@} < 2 )) && changelog_msg="$error_msg" + (( ${#@} < 4 )) && changelog_msg="$error_msg" gh_write_to_changelog_named_text_ln "$error_msg_name_to_insert_from" "$error_msg_name" "$changelog_msg" fi @@ -263,7 +263,7 @@ function gh_print_error_and_write_to_changelog_named_text_bullet_ln() if (( ENABLE_GENERATE_CHANGELOG_FILE )); then local changelog_msg="$4" - (( ${#@} < 2 )) && changelog_msg="$error_msg" + (( ${#@} < 4 )) && changelog_msg="$error_msg" gh_write_error_to_changelog_named_text_bullet_ln "$error_msg_name_to_insert_from" "$error_msg_name" "$changelog_msg" fi diff --git a/bash/github/print-notice-ln.sh b/bash/github/print-notice-ln.sh index e7aa433..24a66f2 100644 --- a/bash/github/print-notice-ln.sh +++ b/bash/github/print-notice-ln.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_PRINT_NOTICE_LN_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/print-notice.sh b/bash/github/print-notice.sh index cad3942..692a810 100644 --- a/bash/github/print-notice.sh +++ b/bash/github/print-notice.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_PRINT_NOTICE_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -239,7 +239,7 @@ function gh_print_notice_and_write_to_changelog_named_text_ln() if (( ENABLE_GENERATE_CHANGELOG_FILE )); then local changelog_msg="$4" - (( ${#@} < 2 )) && changelog_msg="$notice_msg" + (( ${#@} < 4 )) && changelog_msg="$notice_msg" gh_write_to_changelog_named_text_ln "$notice_msg_name_to_insert_from" "$notice_msg_name" "$changelog_msg" fi @@ -263,7 +263,7 @@ function gh_print_notice_and_write_to_changelog_named_text_bullet_ln() if (( ENABLE_GENERATE_CHANGELOG_FILE )); then local changelog_msg="$4" - (( ${#@} < 2 )) && changelog_msg="$notice_msg" + (( ${#@} < 4 )) && changelog_msg="$notice_msg" gh_write_notice_to_changelog_named_text_bullet_ln "$notice_msg_name_to_insert_from" "$notice_msg_name" "$changelog_msg" fi diff --git a/bash/github/print-warning-ln.sh b/bash/github/print-warning-ln.sh index bbf391f..119e380 100644 --- a/bash/github/print-warning-ln.sh +++ b/bash/github/print-warning-ln.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_PRINT_WARNING_LN_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/print-warning.sh b/bash/github/print-warning.sh index 564de86..a9db88a 100644 --- a/bash/github/print-warning.sh +++ b/bash/github/print-warning.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_PRINT_WARNING_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -239,7 +239,7 @@ function gh_print_warning_and_write_to_changelog_named_text_ln() if (( ENABLE_GENERATE_CHANGELOG_FILE )); then local changelog_msg="$4" - (( ${#@} < 2 )) && changelog_msg="$warning_msg" + (( ${#@} < 4 )) && changelog_msg="$warning_msg" gh_write_to_changelog_named_text_ln "$warning_msg_name_to_insert_from" "$warning_msg_name" "$changelog_msg" fi @@ -263,7 +263,7 @@ function gh_print_warning_and_write_to_changelog_named_text_bullet_ln() if (( ENABLE_GENERATE_CHANGELOG_FILE )); then local changelog_msg="$4" - (( ${#@} < 2 )) && changelog_msg="$warning_msg" + (( ${#@} < 4 )) && changelog_msg="$warning_msg" gh_write_warning_to_changelog_named_text_bullet_ln "$warning_msg_name_to_insert_from" "$warning_msg_name" "$changelog_msg" fi diff --git a/bash/github/set-env-from-args.sh b/bash/github/set-env-from-args.sh index 818bccc..9eb15ce 100644 --- a/bash/github/set-env-from-args.sh +++ b/bash/github/set-env-from-args.sh @@ -8,10 +8,10 @@ SOURCE_GHWF_SET_ENV_FROM_ARGS_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/github/utils.sh b/bash/github/utils.sh index ac48e71..57e19a0 100644 --- a/bash/github/utils.sh +++ b/bash/github/utils.sh @@ -9,10 +9,10 @@ SOURCE_GHWF_GITHUB_UTILS_SH=1 # including guard -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? diff --git a/bash/inpage/accum-downloads.sh b/bash/inpage/accum-downloads.sh index a2106e3..dd7f7de 100644 --- a/bash/inpage/accum-downloads.sh +++ b/bash/inpage/accum-downloads.sh @@ -4,10 +4,10 @@ # This is a composite script to use from a composite GitHub action. # -[[ -z "$GH_WORKFLOW_ROOT" ]] && { +if [[ -z "$GH_WORKFLOW_ROOT" ]]; then echo "$0: error: \`GH_WORKFLOW_ROOT\` variable must be defined." >&2 exit 255 -} +fi source "$GH_WORKFLOW_ROOT/_externals/tacklelib/bash/tacklelib/bash_tacklelib" || exit $? @@ -18,15 +18,15 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-curl-workflow.sh" tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh" -[[ -z "$query_url" ]] && { +if [[ -z "$query_url" ]]; then gh_print_error_ln "$0: error: \`query_url\` variable is not defined." exit 255 -} +fi -[[ -z "$downloads_sed_regexp" ]] && { +if [[ -z "$downloads_sed_regexp" ]]; then gh_print_error_ln "$0: error: \`downloads_sed_regexp\` variable is not defined." exit 255 -} +fi [[ -z "$stats_by_year_dir" ]] && stats_by_year_dir="$stats_dir/by_year" [[ -z "$stats_json" ]] && stats_json="$stats_dir/latest.json" diff --git a/changelog.txt b/changelog.txt index c54ebeb..5e19d33 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +2023.07.03: +* fixed: bash/github/print-*.sh: minor fixup +* refactor: bash: replaced `[[ ... ]] && { ... }` expressions by `if [[ ... ]]; then ... fi` statement to reduce places with accidental return code change + 2023.07.03: * fixed: bash/github/accum-rate-limits.sh: json format update