Skip to content

Commit

Permalink
Do not copy example files if they do not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Jul 12, 2016
1 parent 41bdba2 commit 7dc0fb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions urlwatch
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def edit_yaml(yaml_file, parser, example_file=None):
try:
if os.path.exists(yaml_file):
shutil.copy(yaml_file, yaml_edit)
elif example_file is not None:
elif example_file is not None and os.path.exists(example_file):
shutil.copy(example_file, yaml_edit)
subprocess.check_call([editor, yaml_edit])
# Check if we can still parse it
Expand Down Expand Up @@ -168,7 +168,7 @@ def edit_hooks(hooks_file, example_file):
try:
if os.path.exists(hooks_file):
shutil.copy(hooks_file, hooks_edit)
else:
elif example_file is not None and os.path.exists(example_file):
shutil.copy(example_file, hooks_edit)
subprocess.check_call([editor, hooks_edit])
imp.load_source('hooks', hooks_edit)
Expand Down

0 comments on commit 7dc0fb8

Please sign in to comment.