refactor: make things more readable Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
diff --git a/tools/linker.py b/tools/linker.py index 00779c9..82b92eb 100644 --- a/tools/linker.py +++ b/tools/linker.py
@@ -18,19 +18,20 @@ def create_link(source, destination, fallback_copy=False): + copy_function = _copy if fallback_copy else _link try: if os.path.isdir(source): os.makedirs(destination, exist_ok=True) shutil.copytree( source, destination, - copy_function=_copy if fallback_copy else _link, + copy_function=copy_function, symlinks=True, dirs_exist_ok=True, ) else: os.makedirs(os.path.dirname(destination), exist_ok=True) - (_copy if fallback_copy else _link)(source, destination) + copy_function(source, destination) except OSError as e: if not fallback_copy: return create_link(source, destination, fallback_copy=True)