mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
♻️ make checks safer
This commit is contained in:
parent
52d0cc8748
commit
cd7c4a3778
1 changed files with 3 additions and 3 deletions
|
|
@ -23,14 +23,14 @@ class PreRemoveLauncherPaths(PreLaunchHook):
|
|||
# Remove launcher paths from the system
|
||||
paths = []
|
||||
try:
|
||||
ayon_root = self.launch_context.env["AYON_ROOT"]
|
||||
ayon_root = os.path.normpath(self.launch_context.env["AYON_ROOT"])
|
||||
except KeyError:
|
||||
self.log.warning("AYON_ROOT not found in environment variables.")
|
||||
return
|
||||
|
||||
paths.extend(
|
||||
path
|
||||
for path in self.launch_context.env.get("PATH", "").split(os.pathsep)
|
||||
if not path.startswith(ayon_root)
|
||||
for path in self.launch_context.env.get("PATH").split(os.pathsep)
|
||||
if not os.path.normpath(path).startswith(ayon_root)
|
||||
)
|
||||
self.launch_context.env["PATH"] = os.pathsep.join(paths)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue