Allow dotfile-generator to work when the output file does not exist yet
This commit is contained in:
parent
e518752bc3
commit
415a3e5647
5
run.py
5
run.py
@ -112,6 +112,11 @@ def convert_template(env, template, key_value_store, out):
|
||||
current_permissions = os.stat(out).st_mode & 0o777
|
||||
if template_permissions != current_permissions:
|
||||
dryrun_safe_chmod(out, template_permissions)
|
||||
else:
|
||||
dryrun_safe_write(out, rendered)
|
||||
|
||||
if template_permissions != default_permissions:
|
||||
dryrun_safe_chmod(out, template_permissions)
|
||||
|
||||
if args.link:
|
||||
first_line = source.split('\n')[0]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user