From d2c808933771e4a72fb163fb706869c07766ad16 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sun, 12 Mar 2023 15:29:57 +0100 Subject: [PATCH] Expand regular user if not running as root --- mkosi/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkosi/__init__.py b/mkosi/__init__.py index cf8bfa266..d747893b3 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3918,6 +3918,8 @@ def expand_paths(paths: Sequence[str]) -> list[Path]: # No os.path.expandvars because it treats unset variables as empty. expanded = [] for path in paths: + if not sudo_user: + path = os.path.expanduser(path) try: expanded += [Path(string.Template(str(path)).substitute(environ))] except KeyError: -- 2.47.2