Allow expansion of environment variables in paths

This commit is contained in:
Henning Kleen 2022-07-08 14:46:52 +02:00
parent b92a233b1d
commit 7ba7794a14
2 changed files with 4 additions and 1 deletions

View File

@ -357,6 +357,7 @@ class CfgYamlReader(object):
config_error("`import` entry without `file` ({})".format(str(entry)))
else:
config_error("`import` items must be strings or dicts ({})".format(str(entry)))
fn = os.path.expandvars(os.path.expanduser(fn))
if not os.path.isabs(fn):
fn = os.path.join(dir, fn)
if not os.path.isfile(fn):

View File

@ -378,7 +378,9 @@ class KiBoMOptions(BaseOptions):
kibom_command = self.ensure_tool('KiBoM')
format = self.format.lower()
prj = GS.sch_no_ext
config = os.path.join(GS.sch_dir, self.conf)
config = os.path.expandvars(os.path.expanduser(self.conf))
if not os.path.isabs(config):
config = os.path.join(GS.sch_dir, config)
if self.output:
force_output = True
output = name