Skip to content

Commit

Permalink
Check that $SED is executable
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Jul 22, 2019
1 parent d2e0b36 commit 329daeb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/promote-nightly-to-release
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,20 @@ if ! echo "$VERSION" | grep -q -e '^[0-9]\+\.[0-9]\+$'; then
echo "Only specify MAJOR.MINOR version, not MAJOR.MINOR.RELEASE"
exit 1
fi

MAJOR=$(echo "$VERSION" | cut -f1 -d.)
MINOR=$(echo "$VERSION" | cut -f2 -d.)

SED=$(if [ "$(uname -s)" == "Darwin" ]; then echo gsed; else echo sed; fi)

if ! which $SED >/dev/null; then
echo "'$SED' is required."
if [ "$SED" == "gsed" ]; then
echo "Try: brew install gnu-sed"
fi
exit 1
fi

PKGDIR="$(pwd)"
if [ ! -e "$PKGDIR/bin/$(basename $0)" ]; then
echo "This script must be ran from the root of the packaging repository."
Expand Down Expand Up @@ -66,7 +77,6 @@ git clone [email protected]:hhvm/hhvm-docker.git
cd hhvm-docker
statusline "Removing 'latest' from previous release branch tags..."
git checkout "HHVM-${MAJOR}.$(($MINOR - 1))"
SED=$(if [ "$(uname -s)" == "Darwin" ]; then echo gsed; else echo sed; fi)
$SED -i '/^latest$/d' EXTRA_TAGS
git commit EXTRA_TAGS -m "Removing 'latest' tag"
git push
Expand Down

0 comments on commit 329daeb

Please sign in to comment.