Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: address ShellCheck issues #318

Merged
merged 73 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
cb9bb32
Remove runfiles from files.sh.
cgrindel Jul 17, 2023
a1bb832
Address ShellCheck issues in files.sh
cgrindel Jul 17, 2023
82c3aee
Address ShellCheck issues in arrays.sh.
cgrindel Jul 17, 2023
3b2749c
Address ShellCheck issues in assertions.sh.
cgrindel Jul 17, 2023
6addc3e
Address ShellCheck issues in fail.sh.
cgrindel Jul 17, 2023
97e959d
Address ShellCheck issues in git.sh.
cgrindel Jul 17, 2023
26e4780
Address ShellCheck issues in github.sh.
cgrindel Jul 18, 2023
dc23c8c
Address ShellCheck issues in messages.sh.
cgrindel Jul 18, 2023
49fb264
Address ShellCheck issues in paths.sh.
cgrindel Jul 18, 2023
fa407db
Address ShellCheck issues in decompress.sh.tmpl.
cgrindel Jul 18, 2023
e291c16
Address ShellCheck issues in contains_items_perf_comparison.sh.
cgrindel Jul 18, 2023
5ba0393
Address ShellCheck in buildifier_test.sh.
cgrindel Jul 18, 2023
70a0cb5
Address ShellCheck issues in missing_pkgs_test.sh.
cgrindel Jul 18, 2023
892c45b
Address ShellCheck issues in normalize_pkg_test.sh.
cgrindel Jul 18, 2023
3c0cc9e
Address ShellCheck issues in buildifier.sh.
cgrindel Jul 18, 2023
1d3b067
Address ShellCheck issues in find.sh.
cgrindel Jul 18, 2023
8f04e24
Address ShellCheck issues in fix.sh.
cgrindel Jul 18, 2023
282d23f
Fix missing main_branch in generate_gh_changelog.sh.
cgrindel Jul 18, 2023
1ff3e96
Address ShellCheck issues in create_release.sh.
cgrindel Jul 18, 2023
bd82194
Address ShellCheck issues in create_release_tag.sh.
cgrindel Jul 18, 2023
4fac135
Fixed SC issue missed in git.sh.
cgrindel Jul 18, 2023
767046d
Address ShellCheck issues in generate_gh_changelog.sh.
cgrindel Jul 18, 2023
3efb450
Address ShellCheck issues in generate_git_archive.sh.
cgrindel Jul 18, 2023
6d415b8
Address ShellCheck issues in generate_module_snippet.sh.
cgrindel Jul 18, 2023
cf877fe
Address ShellCheck issues in generate_release_notes.sh.
cgrindel Jul 18, 2023
adaceeb
Address ShellCheck issues in generate_sha256.sh.
cgrindel Jul 18, 2023
9ef6521
Address ShellCheck issues in generate_workspace_snippet.sh.
cgrindel Jul 18, 2023
4c7a4e8
Address ShellCheck issues in update_readme.sh.
cgrindel Jul 18, 2023
bf447b2
Add rlocation back to files.sh.
cgrindel Jul 18, 2023
4860b50
Address ShellCheck issues in tidy.sh and check_tidy.sh.
cgrindel Jul 18, 2023
1d4f05f
Address ShellCheck issues in examples/bzlformat/simple_test.sh.
cgrindel Jul 18, 2023
af2c1b1
Address ShellCheck issues in update_markdown_doc.sh.
cgrindel Jul 18, 2023
a7cac02
Address ShellCheck issues in update_markdown_toc.sh.
cgrindel Jul 18, 2023
ed2a60a
Address ShellCheck issues in generate_release_notes_tests.sh.
cgrindel Jul 18, 2023
8863033
Update ShellCheck issues in generate_workspace_snippet_tests.sh,
cgrindel Jul 18, 2023
78b09d9
Address ShellCheck issues in generate_gh_changelog_test.sh.
cgrindel Jul 18, 2023
a40e755
Address ShellCheck issues in generate_git_archive_test.sh.
cgrindel Jul 18, 2023
97f71cc
Address ShellCheck issues in generate_module_snippet_test.sh.
cgrindel Jul 18, 2023
53228a6
Address ShellCheck issues in generate_release_notes_test.sh.
cgrindel Jul 18, 2023
a11b343
Address ShellCheck issues in generate_sha256_test.sh.
cgrindel Jul 18, 2023
6ee7120
Address ShellCheck issues in generate_workspace_snippet_test.sh.
cgrindel Jul 18, 2023
cde8a68
Address ShellCheck issues in update_readme_test.sh.
cgrindel Jul 18, 2023
1a1ff11
Address ShellCheck issues in update_markdown_doc_test.sh.
cgrindel Jul 18, 2023
7a69fc1
Address ShellCheck issues in update_markdown_toc_test.sh.
cgrindel Jul 18, 2023
bc19071
Address ShellCheck issues in contains_item_sorted_test.sh.
cgrindel Jul 18, 2023
72550e9
Address ShellCheck issues in contains_item_test.sh.
cgrindel Jul 18, 2023
dbf6ccd
Address ShellCheck issues in double_quote_items_test.sh.
cgrindel Jul 18, 2023
44cfef4
Address ShellCheck issues in join_by_test.sh.
cgrindel Jul 18, 2023
a9aa98f
Address ShellCheck issues in print_by_line_test.sh.
cgrindel Jul 18, 2023
6cfe61b
Address ShellCheck issues in sort_items_test.sh.
cgrindel Jul 18, 2023
302f19c
Address ShellCheck issues in assert_equal_test.sh.
cgrindel Jul 18, 2023
b8a9508
Address issues in assert_fail.sh.
cgrindel Jul 18, 2023
a28b6d2
Address ShellCheck issues in assert_match_test.sh.
cgrindel Jul 18, 2023
d28bcaf
Address ShellCheck issues in assert_no_match_test.sh.
cgrindel Jul 18, 2023
e4af9ee
Address ShellCheck issues in upsearch_test.sh.
cgrindel Jul 18, 2023
218371e
Address ShellCheck issues in git_integration_test.sh.
cgrindel Jul 18, 2023
fbe882b
Address ShellCheck issues in get_gh_api_base_url_test.sh.
cgrindel Jul 18, 2023
34982a5
Address ShellCheck issues in get_gh_auth_status_test.sh.
cgrindel Jul 18, 2023
5aae806
Address ShellCheck issues in get_gh_changelog_test.sh.
cgrindel Jul 18, 2023
36e6532
Address ShellCheck issues in get_gh_changelog_test.sh.
cgrindel Jul 18, 2023
f0ef1c0
Address ShellCheck issues in get_gh_repo_name_test.sh.
cgrindel Jul 18, 2023
0734706
Address ShellCheck issues in get_gh_repo_owner_test.sh.
cgrindel Jul 18, 2023
22af68e
Address ShellCheck issues in get_gh_username_test.sh.
cgrindel Jul 18, 2023
a2bb7bb
Address ShellCheck issues in is_github_repo_url_test.sh.
cgrindel Jul 18, 2023
543c833
Address ShellCheck issues in exit_with_msg_test.sh.
cgrindel Jul 18, 2023
4798448
Address ShellCheck issues in normalize_path_test.sh.
cgrindel Jul 18, 2023
c7d62ea
Address ShellCheck issues in execute_binary_no_args_test.sh.
cgrindel Jul 18, 2023
c4dd87b
Address ShellCheck issues in execute_binary_with_args_test.sh.
cgrindel Jul 18, 2023
29c48c7
Address ShellCheck issues in find_workspace_eb_test.sh.
cgrindel Jul 18, 2023
137e591
Address ShellCheck issues in my_bin.sh.
cgrindel Jul 18, 2023
7334bad
Address ShellCheck issues in process_file.sh.
cgrindel Jul 18, 2023
2137d60
Address ShellCheck issues in process_file_consumer.sh.
cgrindel Jul 18, 2023
8210e24
Address ShellCheck issues in process_file_consumer_eb_test.sh.
cgrindel Jul 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions bzlformat/tools/buildifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

arrays_sh_location=cgrindel_bazel_starlib/shlib/lib/arrays.sh
arrays_sh="$(rlocation "${arrays_sh_location}")" || \
(echo >&2 "Failed to locate ${arrays_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/arrays.sh
source "${arrays_sh}"

buildifier_location=buildifier_prebuilt/buildifier/buildifier
buildifier="$(rlocation "${buildifier_location}")" || \
(echo >&2 "Failed to locate ${buildifier_location}" && exit 1)


# MARK - Process Args

# Lint Mode
Expand All @@ -40,8 +41,9 @@ lint_mode="off"
warnings="all"

get_usage() {
local utility="$(basename "${BASH_SOURCE[0]}")"
echo "$(cat <<-EOF
local utility
utility="$(basename "${BASH_SOURCE[0]}")"
cat <<-EOF
Executes buildifier for a Starlark file and writes the resulting output to a file.

Usage:
Expand All @@ -53,15 +55,13 @@ Options:
<input> A path to a Starlark file
<output> A path where to write the output from buildifier
EOF
)"
}

args=()
while (("$#")); do
case "${1}" in
"--help")
show_usage
exit 0
;;
"--lint_mode")
lint_mode="${2}"
Expand All @@ -81,9 +81,9 @@ while (("$#")); do
esac
done

[[ ${#args[@]} < 1 ]] && usage_error "Expected a path to a Starlark file."
[[ ${#args[@]} -lt 1 ]] && usage_error "Expected a path to a Starlark file."
bzl_path="${args[0]}"
[[ ${#args[@]} > 1 ]] && out_path="${args[1]}"
[[ ${#args[@]} -gt 1 ]] && out_path="${args[1]}"

contains_item "${lint_mode}" "${lint_modes[@]}" || \
usage_error "Invalid lint_mode (${lint_mode}). Expected to be one of the following: $( join_by ", " "${lint_modes[@]}" )."
Expand All @@ -95,7 +95,7 @@ exec_buildifier() {
local bzl_path="${1}"
shift 1
local buildifier_cmd=( "${buildifier}" "--path=${bzl_path}" )
[[ ${#} > 0 ]] && buildifier_cmd+=( "${@}" )
[[ ${#} -gt 0 ]] && buildifier_cmd+=( "${@}" )
"${buildifier_cmd[@]}"
}

Expand Down
14 changes: 11 additions & 3 deletions bzlformat/tools/missing_pkgs/find.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
# --- end runfiles.bash initialization v3 ---

arrays_lib="$(rlocation cgrindel_bazel_starlib/shlib/lib/arrays.sh)"
# shellcheck source=SCRIPTDIR/../../../shlib/lib/arrays.sh
source "${arrays_lib}"

common_sh_location=cgrindel_bazel_starlib/bzlformat/tools/missing_pkgs/common.sh
common_sh="$(rlocation "${common_sh_location}")" || \
(echo >&2 "Failed to locate ${common_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/common.sh
source "${common_sh}"

query_for_pkgs() {
Expand Down Expand Up @@ -49,8 +51,14 @@ done
cd "${BUILD_WORKSPACE_DIRECTORY}"

# The output `package` appears to sort the results
all_pkgs=( $(query_for_pkgs //...) )
pkgs_with_format=( $(query_for_pkgs 'kind(bzlformat_format, //...)') )
all_pkgs=()
while IFS=$'\n' read -r line; do all_pkgs+=("$line"); done < <(
query_for_pkgs //...
)
pkgs_with_format=()
while IFS=$'\n' read -r line; do pkgs_with_format+=("$line"); done < <(
query_for_pkgs 'kind(bzlformat_format, //...)'
)

pkgs_missing_format=()
for pkg in "${all_pkgs[@]}" ; do
Expand All @@ -59,7 +67,7 @@ for pkg in "${all_pkgs[@]}" ; do
fi
done

if [[ ${#pkgs_missing_format[@]} > 0 ]]; then
if [[ ${#pkgs_missing_format[@]} -gt 0 ]]; then
# Output the missing packages.
print_by_line "${pkgs_missing_format[@]:-}"

Expand Down
12 changes: 9 additions & 3 deletions bzlformat/tools/missing_pkgs/fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
# --- end runfiles.bash initialization v3 ---

arrays_lib="$(rlocation cgrindel_bazel_starlib/shlib/lib/arrays.sh)"
# shellcheck source=SCRIPTDIR/../../../shlib/lib/arrays.sh
source "${arrays_lib}"

common_sh_location=cgrindel_bazel_starlib/bzlformat/tools/missing_pkgs/common.sh
common_sh="$(rlocation "${common_sh_location}")" || \
(echo >&2 "Failed to locate ${common_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/common.sh
source "${common_sh}"

# shellcheck source=SCRIPTDIR/find.sh
find_missing_pkgs_bin="$(rlocation cgrindel_bazel_starlib/bzlformat/tools/missing_pkgs/find.sh)"

buildozer_location=buildifier_prebuilt/buildozer/buildozer
Expand All @@ -32,7 +35,7 @@ args=()
while (("$#")); do
case "${1}" in
"--exclude")
exclude_pkgs+=( $(normalize_pkg "${2}") )
exclude_pkgs+=( "$(normalize_pkg "${2}")" )
shift 2
;;
*)
Expand All @@ -49,10 +52,13 @@ find_args=()
for pkg in "${exclude_pkgs[@]:-}" ; do
find_args+=(--exclude "${pkg}")
done
missing_pkgs=( $(. "${find_missing_pkgs_bin}" "${find_args[@]:-}") )
missing_pkgs=()
while IFS=$'\n' read -r line; do missing_pkgs+=("$line"); done < <(
"${find_missing_pkgs_bin}" "${find_args[@]:-}"
)

# If no missing packages, we are done.
[[ ${#missing_pkgs[@]} == 0 ]] && echo "No missing package updates were found." && exit
[[ ${#missing_pkgs[@]} -eq 0 ]] && echo "No missing package updates were found." && exit

echo "Updating the following packages:"
for pkg in "${missing_pkgs[@]}" ; do
Expand Down
11 changes: 7 additions & 4 deletions bzlrelease/tools/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

env_sh_location=cgrindel_bazel_starlib/shlib/lib/env.sh
env_sh="$(rlocation "${env_sh_location}")" || \
(echo >&2 "Failed to locate ${env_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/env.sh
source "${env_sh}"

git_sh_location=cgrindel_bazel_starlib/shlib/lib/git.sh
git_sh="$(rlocation "${git_sh_location}")" || \
(echo >&2 "Failed to locate ${git_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/git.sh
source "${git_sh}"

github_sh_location=cgrindel_bazel_starlib/shlib/lib/github.sh
github_sh="$(rlocation "${github_sh_location}")" || \
(echo >&2 "Failed to locate ${github_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/github.sh
source "${github_sh}"


Expand All @@ -42,8 +46,9 @@ is_installed gh || fail "Could not find Github CLI (gh)."
# MARK - Usage

get_usage() {
local utility="$(basename "${BASH_SOURCE[0]}")"
echo "$(cat <<-EOF
local utility
utility="$(basename "${BASH_SOURCE[0]}")"
cat <<-EOF
Execute a Github Action workflow to create a relase with the specified tag.

Usage:
Expand All @@ -59,7 +64,6 @@ Options:
--reset_tag If specified and if a release does not exist for the tag,
the existing tag will be deleted and a new one created.
EOF
)"
}


Expand All @@ -72,7 +76,6 @@ while (("$#")); do
case "${1}" in
"--help")
show_usage
exit 0
;;
--workflow)
workflow_name="${2}"
Expand Down
15 changes: 9 additions & 6 deletions bzlrelease/tools/create_release_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

env_sh_location=cgrindel_bazel_starlib/shlib/lib/env.sh
env_sh="$(rlocation "${env_sh_location}")" || \
(echo >&2 "Failed to locate ${env_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/env.sh
source "${env_sh}"

git_sh_location=cgrindel_bazel_starlib/shlib/lib/git.sh
git_sh="$(rlocation "${git_sh_location}")" || \
(echo >&2 "Failed to locate ${git_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/git.sh
source "${git_sh}"

github_sh_location=cgrindel_bazel_starlib/shlib/lib/github.sh
github_sh="$(rlocation "${github_sh_location}")" || \
(echo >&2 "Failed to locate ${github_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/github.sh
source "${github_sh}"


Expand All @@ -44,24 +48,24 @@ is_installed git || fail "Could not find git." "${required_software}"
# MARK - Process Args

get_usage() {
local utility="$(basename "${BASH_SOURCE[0]}")"
echo "$(cat <<-EOF
local utility
utility="$(basename "${BASH_SOURCE[0]}")"
cat <<-EOF
Create a release tag and push it to the remote.

Usage:
${utility} [--remote <remote>] [--branch <branch>] <tag>
EOF
)"
}

reset_tag=false
main_branch=main

args=()
while (("$#")); do
case "${1}" in
"--help")
show_usage
exit 0
;;
--remote)
remote="${2}"
Expand Down Expand Up @@ -108,13 +112,12 @@ if git_tag_exists "${tag}"; then
echo "The tag (${tag}) exists locally, but does not exist on origin."
else
commit="$( get_git_commit_hash "${remote}/${main_branch}" )"
echo "$(cat <<-EOF
cat <<-EOF
Creating release tag.
Tag: ${tag}
Branch: ${main_branch}
Commit: ${commit}
EOF
)"
create_git_release_tag "${tag}" "${commit}"
fi

Expand Down
7 changes: 6 additions & 1 deletion bzlrelease/tools/generate_gh_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

env_sh_location=cgrindel_bazel_starlib/shlib/lib/env.sh
env_sh="$(rlocation "${env_sh_location}")" || \
(echo >&2 "Failed to locate ${env_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/env.sh
source "${env_sh}"

git_sh_location=cgrindel_bazel_starlib/shlib/lib/git.sh
git_sh="$(rlocation "${git_sh_location}")" || \
(echo >&2 "Failed to locate ${git_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/git.sh
source "${git_sh}"

github_sh_location=cgrindel_bazel_starlib/shlib/lib/github.sh
github_sh="$(rlocation "${github_sh_location}")" || \
(echo >&2 "Failed to locate ${github_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/github.sh
source "${github_sh}"


Expand All @@ -42,6 +46,7 @@ is_installed git || fail "Could not find git."

# MARK - Process Arguments

main_branch=main
args=()
while (("$#")); do
case "${1}" in
Expand All @@ -65,14 +70,14 @@ tag_name="${args[0]}"

# MARK - Generate the changelog.

starting_dir="${PWD}"
cd "${BUILD_WORKSPACE_DIRECTORY}"

repo_url="$( get_git_remote_url )"
is_github_repo_url "${repo_url}" || \
fail "The git repository's remote URL does not appear to be a Github URL. ${repo_url}"

# Fetch the latest from origin
# shellcheck disable=SC2119
fetch_latest_from_git_remote

# Construct the args for generating the changelog.
Expand Down
6 changes: 5 additions & 1 deletion bzlrelease/tools/generate_git_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,25 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

env_sh_location=cgrindel_bazel_starlib/shlib/lib/env.sh
env_sh="$(rlocation "${env_sh_location}")" || \
(echo >&2 "Failed to locate ${env_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/env.sh
source "${env_sh}"

git_sh_location=cgrindel_bazel_starlib/shlib/lib/git.sh
git_sh="$(rlocation "${git_sh_location}")" || \
(echo >&2 "Failed to locate ${git_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/git.sh
source "${git_sh}"

github_sh_location=cgrindel_bazel_starlib/shlib/lib/github.sh
github_sh="$(rlocation "${github_sh_location}")" || \
(echo >&2 "Failed to locate ${github_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/github.sh
source "${github_sh}"

is_installed git || fail "This utility requires git to be installed and in the path."
Expand Down Expand Up @@ -90,10 +94,10 @@ done

# MARK - Main

starting_dir="${PWD}"
cd "${BUILD_WORKSPACE_DIRECTORY}"

# Fetch the latest from origin
# shellcheck disable=SC2119
fetch_latest_from_git_remote

if [[ -z "${prefix:-}" ]]; then
Expand Down
1 change: 1 addition & 0 deletions bzlrelease/tools/generate_module_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

# MARK - Process Args
Expand Down
3 changes: 2 additions & 1 deletion bzlrelease/tools/generate_release_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
fail_sh_location=cgrindel_bazel_starlib/shlib/lib/fail.sh
fail_sh="$(rlocation "${fail_sh_location}")" || \
(echo >&2 "Failed to locate ${fail_sh_location}" && exit 1)
# shellcheck source=SCRIPTDIR/../../shlib/lib/fail.sh
source "${fail_sh}"

generate_gh_changelog_sh_location=cgrindel_bazel_starlib/bzlrelease/tools/generate_gh_changelog.sh
Expand Down Expand Up @@ -61,7 +62,7 @@ while (("$#")); do
esac
done

[[ ${#args[@]} == 0 ]] && fail "A tag name for the release must be specified."
[[ ${#args[@]} -eq 0 ]] && fail "A tag name for the release must be specified."
tag_name="${args[0]}"

if [[ -z "${generate_workspace_snippet:-}" ]] && [[ -z "${generate_module_snippet:-}" ]]; then
Expand Down
Loading
Loading