From a455edba9329580a306328d29c0b2e8a4e1ee7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Gaillard?= Date: Mon, 19 Jan 2026 17:03:04 +0100 Subject: [PATCH] docs(fs_utils): add the documentation for create_symlink (#768) --- kiauh/utils/fs_utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kiauh/utils/fs_utils.py b/kiauh/utils/fs_utils.py index 8de2a00..0d14171 100644 --- a/kiauh/utils/fs_utils.py +++ b/kiauh/utils/fs_utils.py @@ -47,7 +47,16 @@ def check_file_exist(file_path: Path, sudo=False) -> bool: def create_symlink(source: Path, target: Path, sudo=False) -> None: + """ + Helper function to create a symlink from source to target + If the target file exists, it will be overwritten. | + :param source: the source file/directory + :param target: the target file/directory + :param sudo: use sudo if required + :return: None + """ try: + # -f forcibly creates/overwrites the symlink cmd = ["ln", "-sf", source.as_posix(), target.as_posix()] if sudo: cmd.insert(0, "sudo")