Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
51 lines (41 loc) · 997 Bytes

File metadata and controls

executable file
·
51 lines (41 loc) · 997 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
set -o errexit
set -o nounset
usage() {
echo "Usage: $0 <major|minor|patch>" 1>&2
exit 1
}
if [ "$#" -ne 1 ]; then
usage
fi
BUMP_TYPE="$1"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
VERSION_FILE="${SCRIPT_DIR}/VERSION"
CURRENT_VERSION="$(cat "$VERSION_FILE")"
MAJOR="$(echo "$CURRENT_VERSION" | cut -d . -f1)"
MINOR="$(echo "$CURRENT_VERSION" | cut -d . -f2)"
PATCH="$(echo "$CURRENT_VERSION" | cut -d . -f3)"
case "$BUMP_TYPE" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
patch)
PATCH=$((PATCH + 1))
;;
*)
usage
;;
esac
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "Bumping version: ${CURRENT_VERSION} -> ${NEW_VERSION}"
echo "$NEW_VERSION" > "$VERSION_FILE"
git -C "$SCRIPT_DIR" commit --only --gpg-sign --signoff \
--message "v${NEW_VERSION}" -- VERSION
git -C "$SCRIPT_DIR" tag --sign "v${NEW_VERSION}" --message "v${NEW_VERSION}"
git -C "$SCRIPT_DIR" log -1 --patch
Morty Proxy This is a proxified and sanitized view of the page, visit original site.