A tool for moving and symlinking directories to a central location
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

27 lines
529 B

import shutil
from pathlib import Path
def move(source: Path, destination: Path) -> None:
"""
Move a file using pathlib
"""
shutil.move(source.expanduser(), destination.expanduser())
def remove(path: Path) -> None:
"""
Remove a file or symlink
"""
if not path.is_symlink() and not path.is_file():
return
path.unlink()
def symlink(target_path: Path, symlink_path: Path) -> None:
"""
Symlink a file or directory
"""
symlink_path.symlink_to(target_path.resolve())