mirror of
https://github.com/mas-cli/mas
synced 2024-11-25 21:10:24 +00:00
📜 Add dry run args to final bump-formula-pr command when formula changes are pending
This commit is contained in:
parent
54af1a2f5b
commit
3e6dafec47
1 changed files with 23 additions and 2 deletions
|
@ -6,6 +6,8 @@
|
||||||
# Updates mas Homebrew core formula:
|
# Updates mas Homebrew core formula:
|
||||||
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
|
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
|
||||||
#
|
#
|
||||||
|
# brew bump-formula-pr --help
|
||||||
|
#
|
||||||
|
|
||||||
BREW_CORE_PATH="$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula"
|
BREW_CORE_PATH="$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula"
|
||||||
|
|
||||||
|
@ -31,9 +33,15 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Checking to see if this update can be a simple bump."
|
echo "Checking to see if this update can be a simple bump."
|
||||||
if ! diff "Homebrew/mas.rb" "$BREW_CORE_PATH/mas.rb"; then
|
diff "Homebrew/mas.rb" "$BREW_CORE_PATH/mas.rb"
|
||||||
|
|
||||||
|
# diff exit status
|
||||||
|
status=$?
|
||||||
|
formula_revisions=0
|
||||||
|
if test $status -ne 0; then
|
||||||
echo "There are changes in the local formula (Homebrew/mas.rb) that haven't been released yet."
|
echo "There are changes in the local formula (Homebrew/mas.rb) that haven't been released yet."
|
||||||
exit 1
|
#exit $status
|
||||||
|
formula_revisions=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> 🧪 Updating homebrew-core formula mas ($VERSION, $REVISION)"
|
echo "==> 🧪 Updating homebrew-core formula mas ($VERSION, $REVISION)"
|
||||||
|
@ -45,12 +53,25 @@ brew bump-formula-pr \
|
||||||
--strict \
|
--strict \
|
||||||
mas
|
mas
|
||||||
|
|
||||||
|
# brew exit status
|
||||||
|
status=$?
|
||||||
|
if test $status -ne 0; then
|
||||||
|
echo "Formula did not validate using brew bump-formula-pr"
|
||||||
|
exit $status
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "$BREW_CORE_PATH"
|
pushd "$BREW_CORE_PATH"
|
||||||
|
|
||||||
echo "Updating formula"
|
echo "Updating formula"
|
||||||
|
if test $formula_revisions -eq 1; then
|
||||||
|
#
|
||||||
|
dry_run="--dry-run --write"
|
||||||
|
fi
|
||||||
|
|
||||||
brew bump-formula-pr \
|
brew bump-formula-pr \
|
||||||
--tag="$VERSION" \
|
--tag="$VERSION" \
|
||||||
--revision="$REVISION" \
|
--revision="$REVISION" \
|
||||||
--strict \
|
--strict \
|
||||||
--verbose \
|
--verbose \
|
||||||
|
$dry_run \
|
||||||
mas
|
mas
|
||||||
|
|
Loading…
Reference in a new issue