let files = List.map ((//) template_dir) files in
let files =
List.filter (fun name -> Filename.check_suffix name ".template") files in
- List.map (
- fun filename ->
- let name = Filename.basename filename in
- let name = Filename.chop_suffix name ".template" in
- (name, filename)
- ) files
+ let templates =
+ List.map (
+ fun filename ->
+ let name = Filename.basename filename in
+ let name = Filename.chop_suffix name ".template" in
+ (name, filename)
+ ) files in
+ List.sort compare templates
let template_names () = List.map fst (templates ())