Skip to content

Instantly share code, notes, and snippets.

@vpodzime
Created June 4, 2019 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpodzime/d52cb9982119b4b2753e4f128fef627e to your computer and use it in GitHub Desktop.
Save vpodzime/d52cb9982119b4b2753e4f128fef627e to your computer and use it in GitHub Desktop.
bundle agent __main__ {
vars:
"path" string => getenv("PATH", 1024);
"path_folders" slist => splitstring("$(path)", ":", 128);
"exact_versions" slist => maplist("$(this)/python[23]", @(path_folders));
"just_python" slist => maplist("$(this)/python", @(path_folders));
"globs" slist => getvalues(mergedata(@(exact_versions), @(just_python)));
"python[$(globs)]" slist => findfiles("$(globs)");
"pythons" slist => getvalues(mergedata(getvalues(@(python))));
reports:
# "$PATH: $(path)";
# "path_folders: $(path_folders)";
"found python: $(pythons)";
}
@olehermanse
Copy link

Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment