-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update formula with adding automation script
- Loading branch information
Showing
3 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
*.bk | ||
/env.sh | ||
/HomebrewFormula/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ ! -d '.git' ]; then | ||
echo 'This script must be run at root of the repository' 2>&1 | ||
exit 1 | ||
fi | ||
|
||
if [[ "$1" == "" ]]; then | ||
echo 'Usage: update.sh {version}' 2>&1 | ||
exit 1 | ||
fi | ||
|
||
cd ./HomebrewFormula | ||
|
||
VERSION="$1" | ||
|
||
echo "Update formula to version ${VERSION}" | ||
|
||
MAC_ZIP="git-brws-${VERSION}-x86_64-apple-darwin.zip" | ||
MAC_URL="https://github.com/rhysd/git-brws/releases/download/${VERSION}/${MAC_ZIP}" | ||
|
||
echo "Downloading ${MAC_ZIP}..." | ||
curl -LO "$MAC_URL" | ||
MAC_SHA="$(shasum -a 256 "$MAC_ZIP" | cut -f 1 -d ' ')" | ||
echo "Mac sha256: ${MAC_SHA}" | ||
sed -i '' -E "s/ sha256 '[0-9a-f]*' # mac/ sha256 '${MAC_SHA}' # mac/" git-brws.rb | ||
|
||
|
||
LINUX_ZIP="git-brws-${VERSION}-x86_64-unknown-linux-gnu.zip" | ||
LINUX_URL="https://github.com/rhysd/git-brws/releases/download/${VERSION}/${LINUX_ZIP}" | ||
|
||
echo "Downloading ${LINUX_ZIP}..." | ||
curl -LO "$LINUX_URL" | ||
LINUX_SHA="$(shasum -a 256 "$LINUX_ZIP" | cut -f 1 -d ' ')" | ||
echo "Linux sha256: ${LINUX_SHA}" | ||
sed -i '' -E "s/ sha256 '[0-9a-f]*' # linux/ sha256 '${LINUX_SHA}' # linux/" git-brws.rb | ||
|
||
echo "Version: ${VERSION}" | ||
sed -i '' -E "s/ version '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'/ version '${VERSION}'/" git-brws.rb | ||
|
||
echo "Clean up zip files" | ||
rm -rf ./*.zip | ||
|
||
echo 'Done.' | ||
|