diff --git a/dotfiles/crontab b/dotfiles/crontab index a7dc135..6bc6259 100644 --- a/dotfiles/crontab +++ b/dotfiles/crontab @@ -1,5 +1,5 @@ # {{@@ header() @@}} -PATH={{@@ env["PATH"] @@}} +PATH={{@@ ordered_path() @@}} #minute hour day month day_week cmd */5 * * * * forecast json diff --git a/funcs.py b/funcs.py index 8499c6d..1af0f99 100644 --- a/funcs.py +++ b/funcs.py @@ -3,3 +3,14 @@ import os def parent_dir(path): return os.path.split(path)[0] + + +def ordered_path(): + PATH = os.environ['PATH'] + + newPATH = [] + for i in PATH.split(":"): + if i not in newPATH: + newPATH.append(i) + + return ':'.join(newPATH)