mirror of
https://github.com/denisidoro/navi
synced 2024-12-01 07:49:11 +00:00
parent
1a111a97d6
commit
62d64c2e03
1 changed files with 40 additions and 12 deletions
|
@ -4,27 +4,55 @@ set -euo pipefail
|
||||||
export SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
export SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
echo "git pull"
|
command_exists () {
|
||||||
git pull
|
type "$1" &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
echoerr() {
|
||||||
|
echo "$@" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
sha256() {
|
||||||
|
if command_exists sha256sum; then
|
||||||
|
sha256sum
|
||||||
|
elif command_exists shasum; then
|
||||||
|
shasum -a 256
|
||||||
|
elif command_exists openssl; then
|
||||||
|
openssl dgst -sha256
|
||||||
|
else
|
||||||
|
echoerr "Unable to calculate sha256!"
|
||||||
|
exit 43
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
header() {
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
header "git pull"
|
||||||
|
#git pull
|
||||||
|
|
||||||
version="$(grep VERSION "${SCRIPT_DIR}/navi" | grep -Eo '[0-9\.]+')"
|
version="$(grep VERSION "${SCRIPT_DIR}/navi" | grep -Eo '[0-9\.]+')"
|
||||||
tag="v${version}"
|
tag="v${version}"
|
||||||
tar="https://github.com/denisidoro/navi/archive/${tag}.tar.gz"
|
tar="https://github.com/denisidoro/navi/archive/${tag}.tar.gz"
|
||||||
formula="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/navi.rb"
|
formula="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/navi.rb"
|
||||||
|
|
||||||
echo "Attempting to release version ${tag}..."
|
header "Attempting to release version ${tag}..."
|
||||||
|
read -p "Press enter to continue"
|
||||||
|
|
||||||
echo "git tag"
|
header "git tag"
|
||||||
git tag -a "$tag" -m "$tag"
|
#git tag -a "$tag" -m "$tag"
|
||||||
|
|
||||||
echo "git push"
|
header "git push"
|
||||||
git push --follow-tags
|
#git push --follow-tags
|
||||||
|
|
||||||
echo "rm formula"
|
header "rm formula"
|
||||||
rm "$formula" || true
|
rm "$formula" || true
|
||||||
|
|
||||||
echo "brew create"
|
header "tar sha256"
|
||||||
brew create "$tar"
|
sha="$(curl -sL "$tar" | sha256 | awk '{print $1}')"
|
||||||
|
|
||||||
echo "output"
|
header "output"
|
||||||
grep "url" "$formula" -A1
|
echo " url \"${tar}\""
|
||||||
|
echo " sha256 \"${sha}\""
|
Loading…
Reference in a new issue