use a sorted PATH to avoid re-runs

This commit is contained in:
lelgenio 2020-10-05 21:09:07 -03:00
parent 467d4fac4b
commit 302240df65
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# {{@@ header() @@}}
PATH={{@@ env["PATH"] @@}}
PATH={{@@ ordered_path() @@}}
#minute hour day month day_week cmd
*/5 * * * * forecast json

View File

@ -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)