Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion FixPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def isMac():
return False


def log(message):
print("FixMacPath: " + message)


if isMac():
fixPathSettings = None
originalEnv = {}
Expand All @@ -37,11 +41,14 @@ def fixPath():
currSysPath = getSysPath()
# Basic sanity check to make sure our new path is not empty
if len(currSysPath) < 1:
log("Something went wrong, generated PATH would have been empty. Aborting.")
return False

log("Setting PATH to " + currSysPath)
environ['PATH'] = currSysPath

for pathItem in fixPathSettings.get("additional_path_items", []):
log("Adding additonal item " + pathItem + " to PATH")
environ['PATH'] = pathItem + ':' + environ['PATH']

return True
Expand Down Expand Up @@ -86,4 +93,4 @@ def plugin_unloaded():


else: # not isMac()
print("FixMacPath will not be loaded because current OS is not Mac OS X ('Darwin'). Found '" + platform.system() + "'")
log("FixMacPath will not be loaded because current OS is not Mac OS X ('Darwin'). Found '" + platform.system() + "'")