Commits

andrea_crotti  committed 9f3bea7

revert the changes to make the writer more safe, since the render is
used also for other files which are safe to be overwritten

  • Participants
  • Parent commits 3040f8a

Comments (0)

Files changed (2)

File tinkerer/cmdline.py

     '''
     Sets up a new blog in the current directory.
     '''
-    if writer.setup_blog():
-        if filename_only:
-            print("conf.py")
-        elif not quiet:
-            print("Your new blog is almost ready!")
-            print("You just need to edit a couple of lines in %s" % (os.path.relpath(paths.conf_file), ))
+    writer.setup_blog()
+
+    if filename_only:
+        print("conf.py")
+    elif not quiet:
+        print("Your new blog is almost ready!")
+        print("You just need to edit a couple of lines in %s" % (os.path.relpath(paths.conf_file), ))
 
 
 

File tinkerer/writer.py

     CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
-from os import path
 
 from jinja2 import Environment, PackageLoader
 from tinkerer import paths, utils
     '''
     Renders the given template at the given destination with the given context.
     '''
-    if path.exists(destination):
-        print("%s already exists, remove it first and run it again" % destination)
-        return False
-    else:
-        with open(destination, "w") as dest:
-            dest.write(env.get_template(template).render(context))
-
-        return True
+    with open(destination, "w") as dest:
+        dest.write(env.get_template(template).render(context))
 
 
 def write_master_file():