Skip to content

Commit

Permalink
Merge pull request #144 from consideRatio/pr/fix-for-extra-paths
Browse files Browse the repository at this point in the history
Stop assuming PATH env is defined when extra_paths is set, and then initialize to os.defpath
  • Loading branch information
consideRatio authored Oct 20, 2024
2 parents 45b06fe + fbddd86 commit ba131ab
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions systemdspawner/systemdspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,11 @@ async def start(self):
properties["PrivateDevices"] = "yes"

if self.extra_paths:
env["PATH"] = "{extrapath}:{curpath}".format(
curpath=env["PATH"],
extrapath=":".join(
[self._expand_user_vars(p) for p in self.extra_paths]
),
)
new_path_list = [self._expand_user_vars(p) for p in self.extra_paths]
current_or_default_path = env.get("PATH", os.defpath)
if current_or_default_path:
new_path_list.append(current_or_default_path)
env["PATH"] = ":".join(new_path_list)

env["SHELL"] = self.default_shell

Expand Down

0 comments on commit ba131ab

Please sign in to comment.