Use expanduser in init-templatedir like git does

This commit is contained in:
Anthony Sottile
2019-08-03 13:30:13 -07:00
parent cab8036db3
commit f48c0abcbe
2 changed files with 19 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ def init_templatedir(config_file, store, directory, hook_type):
except CalledProcessError:
configured_path = None
else:
configured_path = os.path.realpath(out.strip())
configured_path = os.path.realpath(os.path.expanduser(out.strip()))
dest = os.path.realpath(directory)
if configured_path != dest:
logger.warning('`init.templateDir` not set to the target directory')