Skip to content

Commit

Permalink
Set $HOME to the user's home directory in sync scripts
Browse files Browse the repository at this point in the history
Makes sure git can find the user's git configuration.
  • Loading branch information
DaanDeMeyer committed Mar 20, 2024
1 parent 2b22dbd commit 03d77a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def run_sync_scripts(context: Context) -> None:
# git repository and might need to modify the git config in the parent git repository when submodules
# are in use as well.
mounts += [Mount(p, p)]
env["HOME"] = os.fspath(p)
if (p := Path(f"/run/user/{INVOKING_USER.uid}")).exists():
mounts += [Mount(p, p, ro=True)]

Expand Down

0 comments on commit 03d77a5

Please sign in to comment.