Commit bf737894 authored by Denis Salem's avatar Denis Salem
Browse files

rm newly created entry if error during the process.

parent 6d581ea4
......@@ -5,4 +5,3 @@ override:
columns: 1
assets_dependencies: ['VenC-Categories-0.0.0.js']
......@@ -94,12 +94,14 @@ def new_entry(argv):
pass
except PermissionError:
os.remove(output_filename)
die(messages.wrong_permissions.format(template_path))
if not found_template:
os.remove(output_filename)
notify(messages.file_not_found.format(templates_paths[0]), color="RED")
die(messages.file_not_found.format(templates_paths[1]))
stream.write(output)
stream.close()
......@@ -109,6 +111,7 @@ def new_entry(argv):
subprocess.call(command)
except FileNotFoundError:
os.remove(output_filename)
die(messages.unknown_command.format(blog_configuration["text_editor"]))
notify(messages.entry_written)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment