1
0
Fork 0

lazygit: fix autotagging keybind

This commit is contained in:
Luca Bilke 2024-10-09 15:21:39 +02:00
parent 10d1a0100f
commit e763361a3a

View file

@ -55,7 +55,13 @@ customCommands:
description: "prune local branches that have been merged to main/master"
- key: "<c-t>"
context: "global"
command: "tag=$(date +%Y).$(date +%m | sed 's/^0//').$(($(git tag --sort=-v:refname | grep ^$MAJOR.$MINOR | head -n 1 | cut -d . -f 3) + 1)); git tag -m '' $tag; git push {{ .SelectedRemote.Name }} $tag;"
command: |
major=$(date +%Y)
minor=$(date +%m | sed 's/^0//')
patch=$(($(git tag --sort=-v:refname | grep ^$major\.$minor | head -n 1 | cut -d . -f 3) + 1))
tag="${major}.${minor}.${patch}"
git tag -m '' "$tag"
git push {{ .SelectedRemote.Name }} "$tag"
description: "Create and push a tag based off the date"
loadingText: "Tagging/Pushing..."
- key: "<c-v>"