only rewrite utility files if contents changed

This commit is contained in:
Mike Fährmann
2023-01-27 18:04:13 +01:00
parent 0d818d3540
commit e60ec1699a
7 changed files with 52 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ for action in option.build_parser()._actions:
opts.append(opt)
PATH = util.path("data/completion/gallery-dl")
with open(PATH, "w", encoding="utf-8") as file:
with util.lazy(PATH) as file:
file.write(TEMPLATE % {
"opts" : " ".join(opts),
"diropts" : "|".join(diropts),