From 6c422dd3b5ca66168d83eddc6f9237f60a2602fc Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2019 16:50:25 -0600 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20brew=5Fformula=5Fbump=20scrip?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_bump | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 script/brew_formula_bump diff --git a/script/brew_formula_bump b/script/brew_formula_bump new file mode 100755 index 0000000..a7c664a --- /dev/null +++ b/script/brew_formula_bump @@ -0,0 +1,52 @@ +#!/bin/bash -e +# +# script/brew_formula_bump +# mas +# +# Updates mas Homebrew core formula: +# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb +# + +# BUILD_DIR="$PWD/build" +# OS_VERSIONS=(mojave high_sierra sierra el_capitan) + +function usage { + echo "Usage: brew_formula_bump [v1.0] [sha1_hash]" + echo "- version will be inferred using version script if not provided" + echo "- sha will be inferred from the curreent commit if not provided" + exit 1 +} + +# arg 1 - version tag +if test -n "$1"; then + VERSION="$1" +else + VERSION="v$(script/version)" +fi + +# arg 2 - revision (commit hash) +if test -n "$2"; then + REVISION="$2" +else + REVISION=$(git rev-parse HEAD) +fi + +echo "==> 🧪 Updating homebrew-core formula mas ($VERSION, $REVISION)" + +echo "Validating formula" +brew bump-formula-pr \ + --tag="$VERSION" \ + --revision="$REVISION" \ + --strict \ + mas + +pushd "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula" + +echo "Updating formula" +brew bump-formula-pr \ + --tag="$VERSION" \ + --revision="$REVISION" \ + --strict \ + --verbose \ + --debug \ + mas