From 133ad410153ae16ca890c39ac48422e0268fee97 Mon Sep 17 00:00:00 2001 From: Michael Hurley Date: Thu, 8 Sep 2016 18:57:07 -0400 Subject: [PATCH] guard against minimal environments --- xyz | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xyz b/xyz index 71ea2f3..ac58de2 100755 --- a/xyz +++ b/xyz @@ -119,8 +119,11 @@ next_version=$("$dir/node_modules/.bin/semver" -i "$increment" "$version") || message="${message_template//X.Y.Z/$next_version}" tag="${tag_template//X.Y.Z/$next_version}" -bold=$(tput bold) -reset=$(tput sgr0) +if type tput &>/dev/null ; then + bold=$(tput bold) + reset=$(tput sgr0) +fi + printf "Current version is ${bold}${version}${reset}. " printf "Press [enter] to publish ${bold}${name}@${next_version}${reset}." read -s # suppress user input