1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

scripts/maintenance/tag-route53-hosted-zones: Error messages for missing deps

At least on Bash 4.4, the -V form writes a missing-command message to
stderr:

  $ echo $BASH_VERSION
  4.4.23(1)-release
  $ command -v does-not-exist >/dev/null
  $ command -V does-not-exist >/dev/null
  -bash: command: does-not-exist: not found

Because we're not redirecting command's stderr in the script, it will
fall through to the caller's stderr and make it easier for them to
figure out what went wrong.

Also write a "Missing required dependencies" string to stderr.  We'd
had a "Dependencies not installed." string literal from 82bdd9fe
(installer/scripts: AWS tag and delete scripts, 2017-06-28,
coreos/tectonic-installer#1239), but it hadn't been written anywhere
so it was effectively an internal comment.
This commit is contained in:
W. Trevor King
2018-07-08 13:59:20 -07:00
parent da45d540dc
commit 2aea052782

View File

@@ -45,8 +45,8 @@ while [ $# -gt 0 ]; do
shift
done
if ! command -v jq > /dev/null || ! command -v aws > /dev/null; then
"Dependencies not installed."
if ! command -V jq >/dev/null || ! command -V aws >/dev/null; then
echo "Missing required dependencies" >&2
exit 1
fi