From: Wlodek Wencel Date: Wed, 30 Nov 2022 11:29:34 +0000 (+0100) Subject: [#2657] replace ~/ with absolute path X-Git-Tag: Kea-2.3.4~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edaf9ab0660d7ebdae8a728ce5aa1a273607e476;p=thirdparty%2Fkea.git [#2657] replace ~/ with absolute path --- diff --git a/hammer.py b/hammer.py index 0c2bc62f46..01170b5a11 100755 --- a/hammer.py +++ b/hammer.py @@ -335,6 +335,9 @@ def execute(cmd, timeout=60, cwd=None, env=None, raise_error=True, dry_run=False quiet = True if not super_quiet: log.info('>>>>> Executing %s in %s', cmd, cwd if cwd else os.getcwd()) + if cwd and "~/" in cwd: + # replace relative home directory + cwd = cwd.replace('~', execute('cd ~ && pwd', capture=True, super_quiet=True)[1].rstrip()) if not check_times: timeout = None if dry_run: