Skip to content

Commit

Permalink
applying brew style --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
angelobanse committed Oct 12, 2024
1 parent 2fa8ec0 commit 7581e09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Alternatively, ```brew``` can compile SUMO from source with the following comman


brew install [OPTIONS] sumo

==> Options
--with-examples
Install docs/examples and docs/tutorial folder
Expand Down
23 changes: 12 additions & 11 deletions update_formula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ FORMULA_NAME=dlr-ts/sumo/sumo
README_FILE=README.md

# check for cmd line parameters
if [[ $# -ne 2 ]]; then
echo ""
echo "Usage: $0 <NEW_VERSION> <SUMO_SRC_URL>"
echo "Examples:"
echo " NEW_VERSION: 1.3.1"
echo " SUMO_SRC_URL: https://github.com/eclipse-sumo/sumo/archive/v1_3_1.tar.gz"
echo ""
exit 1
if [[ $# -ne 2 ]]
then
echo ""
echo "Usage: $0 <NEW_VERSION> <SUMO_SRC_URL>"
echo "Examples:"
echo " NEW_VERSION: 1.3.1"
echo " SUMO_SRC_URL: https://github.com/eclipse-sumo/sumo/archive/v1_3_1.tar.gz"
echo ""
exit 1
fi

NEW_VERSION="$1"
Expand Down Expand Up @@ -45,7 +46,7 @@ ARCHIVED_FORMULA_FILENAME="sumo@${OLD_VERSION}.rb"

# archive old formula
echo "copying formula to Formula/${ARCHIVED_FORMULA_FILENAME} and updating class name of archived formula..."
sed "s/class Sumo/class ${FORMULA_CLASS_NAME}/" Formula/sumo.rb >> Formula/"${ARCHIVED_FORMULA_FILENAME}"
sed "s/class Sumo/class ${FORMULA_CLASS_NAME}/" Formula/sumo.rb >>Formula/"${ARCHIVED_FORMULA_FILENAME}"
echo "done archiving old formula!"

echo "creating git branch"
Expand All @@ -60,7 +61,7 @@ echo "bumping formula version..."
brew bump-formula-pr -v --write-only --no-audit --url="${SUMO_SRC_URL}" "${FORMULA_NAME}"
# remove bottle block
# NOTE: dirty hack assumes lines 12-17 (including extra blank line)
sed '12,17d' /usr/local/Homebrew/Library/Taps/dlr-ts/homebrew-sumo/Formula/sumo.rb > Formula/sumo.rb
sed '12,17d' /usr/local/Homebrew/Library/Taps/dlr-ts/homebrew-sumo/Formula/sumo.rb >Formula/sumo.rb
git add Formula/sumo.rb
git commit -m "sumo: update formula to v${NEW_VERSION}"

Expand All @@ -71,7 +72,7 @@ git commit -m "sumo: update alias"

### UPDATE version number in README.md
echo "updating version number in README.md"
sed "s/${OLD_VERSION}/${NEW_VERSION}/" "${README_FILE}" >> "${README_FILE}.NEW"
sed "s/${OLD_VERSION}/${NEW_VERSION}/" "${README_FILE}" >>"${README_FILE}.NEW"
mv "${README_FILE}.NEW" "${README_FILE}"
git add "${README_FILE}"
git commit -m "update version number in README"
Expand Down

0 comments on commit 7581e09

Please sign in to comment.