X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=dotfiles2html%2Fdotfiles2html.py;h=504261969124c84d61c6afa1304362d990198443;hb=64481e7a6835d1ba04817105518511fe8b23e3b0;hp=8952fe862931ed14f0aeff1672eb3ecfe5444e8d;hpb=3a6c1b4d3f07d18b433aaa9c79114134be3a9517;p=phdru.name%2Fphdru.name.git diff --git a/dotfiles2html/dotfiles2html.py b/dotfiles2html/dotfiles2html.py index 8952fe8..5042619 100755 --- a/dotfiles2html/dotfiles2html.py +++ b/dotfiles2html/dotfiles2html.py @@ -69,8 +69,8 @@ for i, (fname, ftype) in enumerate(file_types): else: next = file_types[i+1][0] add_headers(fname, prev, next) - if not filecmp.cmp(fname + ".html", fname + ".tmpl"): - os.rename(fname + ".html", fname + ".tmpl") - else: + if os.path.exists(fname + ".tmpl") and filecmp.cmp(fname + ".html", fname + ".tmpl"): os.remove(fname + ".html") + else: + os.rename(fname + ".html", fname + ".tmpl") os.chmod(fname, 0644)