Write to stderr where appropriate.

Partial #638

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-11-16 00:45:49 -05:00
parent 92660f665b
commit 53958a40c5
No known key found for this signature in database
7 changed files with 23 additions and 23 deletions

View file

@ -14,8 +14,8 @@ if ! cd -- "${mas_dir}"; then
fi
function usage {
echo 'Usage: bootstrap [-f]'
echo ' -f option enables frozen mode'
echo 'Usage: bootstrap [-f]' >&2
echo ' -f option enables frozen mode' >&2
exit 1
}
@ -26,7 +26,7 @@ while getopts 'f' opt; do
frozen='--no-lock --no-upgrade'
;;
*)
usage 1>&2
usage
;;
esac
done

View file

@ -74,7 +74,7 @@ case "${CURRENT_OS_VERSION_MAJOR}" in
CURRENT_PLATFORM=catalina
;;
*)
echo 'Unsupported macOS version. This script requires Catalina or newer.'
echo 'Unsupported macOS version. This script requires Catalina or newer.' >&2
exit 1
;;
esac
@ -122,9 +122,9 @@ brew install --build-bottle mas-cli/tap/mas
# Generate bottle do block, dropping last 2 lines
brew bottle --verbose --no-rebuild --root-url="${ROOT_URL}" mas-cli/tap/mas
if [[ ! -e "${OLD_FILENAME}" ]]; then
echo "Bottle not found: ${OLD_FILENAME}"
echo 'If an old version is showing in the log and filename, then make sure the formula has been updated in:'
echo "${CORE_TAP_PATH}"
echo "Bottle not found: ${OLD_FILENAME}" >&2
echo 'If an old version is showing in the log and filename, then make sure the formula has been updated in:' >&2
echo "${CORE_TAP_PATH}" >&2
exit 1
fi

View file

@ -19,16 +19,16 @@ fi
CORE_TAP_PATH="$(brew --repo homebrew/core)"
function usage {
echo 'Usage: brew_core_update [-d] [<version_tag> [<sha1_hash>]]'
echo ' -d option enables dry run mode'
echo ' version will be inferred using version script if not provided'
echo ' sha will be inferred from the current commit if not provided'
echo 'Usage: brew_core_update [-d] [<version_tag> [<sha1_hash>]]' >&2
echo ' -d option enables dry run mode' >&2
echo ' version will be inferred using version script if not provided' >&2
echo ' sha will be inferred from the current commit if not provided' >&2
exit 1
}
# Max 3 arguments
if [[ "${#}" -gt 3 ]]; then
usage 1>&2
usage
fi
dry_run=
@ -40,7 +40,7 @@ while getopts 'd' o; do
dry_run=-d
;;
*)
usage 1>&2
usage
;;
esac
done
@ -133,7 +133,7 @@ brew bump-formula-pr \
# brew exit status
status="${?}"
if [[ "${status}" -ne 0 ]]; then
echo $'Formula did not validate using \'brew bump-formula-pr\'' 1>&2
echo $'Formula did not validate using \'brew bump-formula-pr\'' >&2
exit "${status}"
fi

View file

@ -15,15 +15,15 @@ if ! cd -- "${mas_dir}"; then
fi
function usage {
echo 'Usage: brew_tap_update [<version_tag> [<sha1_hash>]]'
echo ' version will be inferred using version script if not provided'
echo ' sha will be inferred from the current commit if not provided'
echo 'Usage: brew_tap_update [<version_tag> [<sha1_hash>]]' >&2
echo ' version will be inferred using version script if not provided' >&2
echo ' sha will be inferred from the current commit if not provided' >&2
exit 1
}
# Max 2 arguments
if [[ "${#}" -gt 2 ]]; then
usage 1>&2
usage
fi
# arg 1 - version tag

View file

@ -21,7 +21,7 @@ printf $'==> 🚨 Formatting mas\n'
for LINTER in markdownlint prettier shfmt swift-format swiftformat swiftlint yamllint; do
if [[ ! -x "$(command -v "${LINTER}")" ]]; then
printf $'error: %s is not installed. Run \'script/bootstrap\' or \'brew install %s\'.\n' "${LINTER}" "${LINTER}"
printf $'error: %s is not installed. Run \'script/bootstrap\' or \'brew install %s\'.\n' "${LINTER}" "${LINTER}" >&2
exit 1
fi
done

View file

@ -23,7 +23,7 @@ printf $'==> 🚨 Linting mas (%s)\n' "$(script/version --write)"
for linter in git markdownlint periphery shellcheck shfmt swift-format swiftformat swiftlint yamllint; do
if [[ ! -x "$(command -v "${linter}")" ]]; then
printf $'error: %s is not installed. Run \'script/bootstrap\' or \'brew install %s\'.\n' "${linter}" "${linter}"
printf $'error: %s is not installed. Run \'script/bootstrap\' or \'brew install %s\'.\n' "${linter}" "${linter}" >&2
exit 1
fi
done

View file

@ -18,9 +18,9 @@ LOCAL_TAP_FORMULA_PATH=Homebrew/mas-tap.rb
SWIFT_PACKAGE=Sources/mas/Package.swift
function usage {
echo 'Usage: version_bump <version_tag> [<sha1_hash>]'
echo ' existing tag name'
echo ' sha will be inferred from the given tag if not provided'
echo 'Usage: version_bump <version_tag> [<sha1_hash>]' >&2
echo ' existing tag name' >&2
echo ' sha will be inferred from the given tag if not provided' >&2
exit 1
}