From a117211bd26590fecd00379417f890d8f3785329 Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Mon, 27 Dec 2021 16:05:19 +0100 Subject: [PATCH] Only change symlink if it is not already correct --- run.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/run.py b/run.py index f3311de..0d68bbe 100755 --- a/run.py +++ b/run.py @@ -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