Only change symlink if it is not already correct

This commit is contained in:
Daniel_I_Am 2021-12-27 16:05:19 +01:00
parent c169e557cd
commit a117211bd2

3
run.py
View File

@ -118,6 +118,9 @@ def convert_template(env, template, key_value_store, out):
def create_symlink(source, destination):
if os.path.exists(destination):
if os.path.islink(destination) and os.readlink(destination) == source:
return
if not args.force:
print('`{destination}` already exists, will not overwrite. Rerun with `-f` to force overwiring existing files.', file=sys.stderr)
return