]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Fixed a bug: do not compare if the template does not exist yet.
authorOleg Broytman <phd@phdru.name>
Fri, 31 Mar 2006 14:55:55 +0000 (14:55 +0000)
committerOleg Broytman <phd@phdru.name>
Fri, 31 Mar 2006 14:55:55 +0000 (14:55 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@46 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

dotfiles2html/dotfiles2html.py

index 8952fe862931ed14f0aeff1672eb3ecfe5444e8d..504261969124c84d61c6afa1304362d990198443 100755 (executable)
@@ -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)