Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Check that $SED is executable (#188)
Browse files Browse the repository at this point in the history
refs #187
  • Loading branch information
fredemmott authored Jul 23, 2019
1 parent a817eda commit d299db7
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 d299db7

Please sign in to comment.