From: Daan De Meyer Date: Wed, 23 Aug 2023 10:58:36 +0000 (+0200) Subject: Use default_factory to evaluate Path.cwd() later X-Git-Tag: v16~44^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=005d1477dfb5929f25d1c20170e2364e276fb9ee;p=thirdparty%2Fmkosi.git Use default_factory to evaluate Path.cwd() later Otherwise, we don't take --directory into account as Path.cwd() is evaluated on module import. --- diff --git a/mkosi/config.py b/mkosi/config.py index 4d3fb60b3..339c45bd5 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -951,7 +951,7 @@ class MkosiConfigParser: section="Output", parse=config_make_path_parser(required=False), paths=("mkosi.output",), - default=Path.cwd(), + default_factory=lambda _: Path.cwd(), help="Output directory", ), MkosiConfigSetting( @@ -961,7 +961,7 @@ class MkosiConfigParser: section="Output", parse=config_make_path_parser(required=False), paths=("mkosi.workspace",), - default=Path.cwd(), + default_factory=lambda _: Path.cwd(), help="Workspace directory", ), MkosiConfigSetting(