Skip to content

Commit 1d20391

Browse files
dycwweb-flow
andauthored
Add bump-my-version aliases (#879)
Co-authored-by: github-actions-bot <noreply@github.com>
1 parent 086ddca commit 1d20391

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

.bumpversion.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configs/bump-my-version/set-up.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env sh
2+
3+
set -eu
4+
5+
###############################################################################
6+
7+
link() {
8+
src="$(dirname -- "$(realpath -- "$0")")/$1"
9+
dest="${XDG_CONFIG_HOME:-${HOME}/.config}/$2"
10+
mkdir -p "$(dirname -- "${dest}")"
11+
ln -sfn "${src}" "${dest}"
12+
}
13+
14+
###############################################################################
15+
16+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Setting up 'bump-my-version'..."
17+
18+
link shell.fish fish/conf.d/bump-my-version.fish

configs/bump-my-version/shell.fish

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env fish
2+
3+
if not status is-interactive; or not type -q bump-my-version
4+
exit
5+
end
6+
7+
###############################################################################
8+
9+
function bump-patch
10+
bump-my-version bump patch
11+
end
12+
13+
function bump-minor
14+
bump-my-version bump minor
15+
end
16+
17+
function bump-major
18+
bump-my-version bump major
19+
end
20+
21+
function bump-set
22+
if test (count $argv) -lt 1
23+
echo "'bump-set' expected [1..) arguments VERSION; got $(count $argv)" >&2; and return 1
24+
end
25+
while true
26+
if bump-my-version replace --new-version $argv[1]
27+
return
28+
end
29+
sleep 2
30+
end
31+
end

0 commit comments

Comments
 (0)