diff --git a/lib/deploy.py b/lib/deploy.py index 52dbdee..bf2c6b4 100644 --- a/lib/deploy.py +++ b/lib/deploy.py @@ -1,5 +1,6 @@ import os -import distutils +import distutils.dir_util +import distutils.file_util import subprocess from pathlib import Path from lib.diff import diff @@ -15,9 +16,9 @@ installed_packages = pacman.get_installed() def copy(source, dest): print(source, '->', dest) if source.is_dir(): - distutils.dir_util.copy_tree(source.absolute(), dest.absolute()) + distutils.dir_util.copy_tree(str(source), str(dest)) else: - distutils.file_util.copy_file(source.absolute(), dest.absolute()) + distutils.file_util.copy_file(str(source), str(dest)) def import_paths(paths, base): if not isinstance(paths, list): diff --git a/lib/diff.py b/lib/diff.py index f44b6fd..7e4d9d4 100644 --- a/lib/diff.py +++ b/lib/diff.py @@ -1,7 +1,7 @@ import lib.proc as proc def diff(file1, file2): - cmd = ['diff', '-r', str(file1.resolve()), str(file2.expanduser())] + cmd = ['diff', '-r', str(file1), str(file2)] subproc = proc.exec(cmd) delta = proc.communicate(subproc, cmd, [0, 1]) diff --git a/lib/path.py b/lib/path.py index 23213ee..891c15e 100644 --- a/lib/path.py +++ b/lib/path.py @@ -10,4 +10,4 @@ def deploy_path(path): start = path.parts[0] target = path.parts[1:] if start == 'lain': - return Path('~') / Path(*target) + return (Path('~') / Path(*target)).expanduser()