1
0
Fork 0
mirror of synced 2024-06-01 18:20:20 +12:00

Replaced os.path in system.py

This commit is contained in:
Angel Rey 2020-09-30 15:04:46 -05:00 committed by Cristian Vargas
parent 16b5ca3207
commit 25ac18c8b7

View file

@ -64,7 +64,7 @@ def chmod_file(path: str, cwd: str='.', permissions: str=OUTPUT_PERMISSIONS) ->
@enforce_types
def copy_and_overwrite(from_path: str, to_path: str):
"""copy a given file or directory to a given path, overwriting the destination"""
if os.path.isdir(from_path):
if Path(from_path).is_dir():
shutil.rmtree(to_path, ignore_errors=True)
shutil.copytree(from_path, to_path)
else: