mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Fix version incrementing
This commit is contained in:
parent
daaf21ca8d
commit
ec9c785c3a
@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file
|
||||
|
||||
- Changelog links dict now contains version links. Modified version links will overwrite those in the table when writing to a file
|
||||
- Changelog object no longer errors when creating without a path.
|
||||
- `release` now resets lesser version values when incrementing
|
||||
|
||||
## 0.3.2 - 2021-04-24
|
||||
|
||||
|
@ -35,11 +35,14 @@ def increment_version(version: str, mode: str) -> str:
|
||||
local = v.local
|
||||
|
||||
if mode == '+M':
|
||||
release = (release[0] + 1,) + release[1:]
|
||||
release = (release[0] + 1,) + ((0,) * len(release[1:]))
|
||||
pre = post = dev = None
|
||||
elif mode == '+m':
|
||||
release = (release[0], release[1] + 1) + release[2:]
|
||||
release = (release[0], release[1] + 1) + ((0,) * len(release[2:]))
|
||||
pre = post = dev = None
|
||||
elif mode == '+p':
|
||||
release = (release[0], release[1], release[2] + 1) + release[3:]
|
||||
release = (release[0], release[1], release[2] + 1) + ((0,) * len(release[3:]))
|
||||
pre = post = dev = None
|
||||
elif mode in ['+a', '+b', '+rc']:
|
||||
if pre[0] == mode[1:]:
|
||||
pre = (mode[1:], pre[1] + 1)
|
||||
|
Loading…
Reference in New Issue
Block a user