Fix license in mbc iit

This commit is contained in:
Tulir Asokan 2019-02-13 18:27:46 +02:00
parent f548e17c80
commit 3068245b1f
2 changed files with 4 additions and 3 deletions

View file

@ -76,7 +76,7 @@ class VersionValidator(ClickValidator):
def spdx(val: str) -> str:
if spdxlib.valid(val):
if not spdxlib.valid(val):
raise click.BadParameter(f"{val} is not a valid SPDX license identifier")
return val

View file

@ -57,8 +57,9 @@ def init(name: str, id: str, version: Version, license: str, config: bool) -> No
main_class=main_class)
with open("maubot.yaml", "w") as file:
file.write(meta)
with open("LICENSE", "w") as file:
file.write(spdx.get(license)["text"])
if license:
with open("LICENSE", "w") as file:
file.write(spdx.get(license)["text"])
if not os.path.isdir(name):
os.mkdir(name)
mod = mod_template.render(config=config, name=main_class)