Skip to content

Instantly share code, notes, and snippets.

@zzamboni
Created November 14, 2012 16:06
Show Gist options
  • Select an option

  • Save zzamboni/4072995 to your computer and use it in GitHub Desktop.

Select an option

Save zzamboni/4072995 to your computer and use it in GitHub Desktop.
vars:
"dir" string => "/etc/apache2/modules-enabled";
"index" slist => getindices("array");
"cindex[$(index)]" string => canonify("$(index)");
"files" slist => lsdir("$(dir)", ".*", "false");
classes:
"should_exist_$(cindex[$(index)])" expression => "any";
files:
"/$(dir)/$(index)"
create => "true";
"/$(dir)/$(files)"
delete => tidy,
ifvarclass => "!should_exist_$(cindex[$(files)])";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment