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
24 changes: 16 additions & 8 deletions FixPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def isMac():

if isMac():
fixPathSettings = None
lastAdditionalPathItems = None
originalEnv = {}

def getSysPath():
Expand All @@ -34,17 +35,24 @@ def getSysPath():


def fixPath():
currSysPath = getSysPath()
# Basic sanity check to make sure our new path is not empty
if len(currSysPath) < 1:
return False
additionalPathItems = fixPathSettings.get("additional_path_items", []);

environ['PATH'] = currSysPath
# Only do work if path items changes
global lastAdditionalPathItems
if additionalPathItems != lastAdditionalPathItems:
lastAdditionalPathItems = additionalPathItems

for pathItem in fixPathSettings.get("additional_path_items", []):
environ['PATH'] = pathItem + ':' + environ['PATH']
currSysPath = getSysPath()
# Basic sanity check to make sure our new path is not empty
if len(currSysPath) < 1:
return False

return True
environ['PATH'] = currSysPath

for pathItem in additionalPathItems:
environ['PATH'] = pathItem + ':' + environ['PATH']

return True


def plugin_loaded():
Expand Down