There was an error while loading. Please reload this page.
1 parent 810ab3a commit a455edbCopy full SHA for a455edb
1 file changed
kiauh/utils/fs_utils.py
@@ -47,7 +47,16 @@ def check_file_exist(file_path: Path, sudo=False) -> bool:
47
48
49
def create_symlink(source: Path, target: Path, sudo=False) -> None:
50
+ """
51
+ Helper function to create a symlink from source to target
52
+ If the target file exists, it will be overwritten. |
53
+ :param source: the source file/directory
54
+ :param target: the target file/directory
55
+ :param sudo: use sudo if required
56
+ :return: None
57
58
try:
59
+ # -f forcibly creates/overwrites the symlink
60
cmd = ["ln", "-sf", source.as_posix(), target.as_posix()]
61
if sudo:
62
cmd.insert(0, "sudo")
0 commit comments