Support relative path for initializing config

Previously, if you passed something like ~/build to the init function
for work directory, it would create a directory, .\~/ in the current
working directory instead of resolving ~/ to the user's home directory.
This allow allows using ../ to specify a path.
This commit is contained in:
Clayton Craft 2017-06-25 16:54:40 +00:00
parent 7380b60472
commit da9af8ee87
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ def init(args):
# Work folder
logging.info("Location of the 'work' path. Multiple chroots (native,"
" device arch, device rootfs) will be created in there.")
cfg["pmbootstrap"]["work"] = pmb.helpers.cli.ask(args, "Work path",
None, args.work, False)
cfg["pmbootstrap"]["work"] = os.path.expanduser(pmb.helpers.cli.ask(args, "Work path",
None, args.work, False))
os.makedirs(cfg["pmbootstrap"]["work"], 0o700, True)
# Parallel job count