Skip to content

Commit

Permalink
Updated path_helper to deal with duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Hartl committed Dec 3, 2019
1 parent 78f824f commit 3fe07cc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/xonshrc.d/path_helper
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ def _update_path(variable, prefix):
print(e, file=sys.stderr)

for directory in ('~/.config/', '/etc/'):
for name in (prefix, prefix + '.d'):
for name in (prefix + '.d', prefix):
location = os.path.join(directory, name)
for path in paths(location):
result.append(path)
if path not in result:
result.append(path)
result.reverse()
for item in result:
try:
variable.remove(item)
except:
pass
for item in result:
variable.insert(0, item)

Expand Down

0 comments on commit 3fe07cc

Please sign in to comment.