LDoc: use string version so trailing 0s don't get trimmed

This commit is contained in:
Jordan Irwin 2021-08-23 14:10:49 -07:00
parent dbe74dcf08
commit 1540c78959
2 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,7 @@ not_luadoc = true
favicon = "https://www.minetest.net/media/icon.svg"
readme = ".ldoc/README.md"
local version = 1.6
local version = "1.6"
file = {
"settings.lua",

View File

@ -46,7 +46,11 @@ for f in to_update:
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)