Skip to content

Commit

Permalink
Use string for version in LDoc config so trailing 0s are trimmed
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Aug 22, 2021
1 parent 020bcc2 commit dd9afb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ldoc/config.ld
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ favicon = "https://www.minetest.net/media/icon.svg"
readme = ".ldoc/README.md"
style = true

local version = 1.10
local version = "1.10"

file = {
"settings.lua",
Expand Down
6 changes: 5 additions & 1 deletion set_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
if not version_set:
if "=" in replacement and li.startswith(replacement):
key = li.split(" = ")[0]
li = "{} = {}".format(key, new_version)
if replacement.startswith("local"):
# use string in LDoc config trailing 0s aren't trimmed
li = '{} = "{}"'.format(key, new_version)
else:
li = "{} = {}".format(key, new_version)
version_set = True
elif li == replacement:
li = "v{}".format(new_version)
Expand Down

0 comments on commit dd9afb1

Please sign in to comment.