From 82f2f7b2b9076fc16d6f7df6c36c0132b28f8a62 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 24 Aug 2015 17:42:08 +0100 Subject: [PATCH] Check for required tooling at top level Pull common checks out to top level in preparation for the introduction of an additional process step. --- bin/release | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/release b/bin/release index 6eb13c6d..9cbae07c 100755 --- a/bin/release +++ b/bin/release @@ -96,13 +96,6 @@ publish() { echo "== Sanity checks" - if ! which github-release >/dev/null; then - echo "Please install git-release:" >&2 - echo -e "\tgo get github.com/aktau/github-release" >&2 - echo "and create a git token per https://github.com/aktau/github-release" >&2 - exit 1 - fi - if ! [ $(git rev-list -1 $LATEST_TAG) == $(git rev-list -1 latest_release) ]; then echo -e "\u2757 The tag latest_release does not point to the same commit as $LATEST_TAG" exit 1 @@ -196,6 +189,14 @@ usage() { echo "-- Publish the artefacts for the latest tag to GitHub and DockerHub" } +# Ensure required tooling is installed +if ! which github-release >/dev/null; then + echo "Please install git-release:" >&2 + echo -e "\tgo get github.com/aktau/github-release" >&2 + echo "and create a git token per https://github.com/aktau/github-release" >&2 + exit 1 +fi + case "$1" in build) build