summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-07-25 13:57:42 -0500
committerGitHub <noreply@github.com>2023-07-25 13:57:42 -0500
commitd97636e39d529067fc9651ac662035847b612214 (patch)
treef8054642beaa60d103e8e1e7b72937d109f1cbe2
parentc5863024949344ceb0faad567bd77489f391d39c (diff)
parent5c85102be8359e41049a6003956987558be1513c (diff)
downloadvyos1x-config-d97636e39d529067fc9651ac662035847b612214.tar.gz
vyos1x-config-d97636e39d529067fc9651ac662035847b612214.zip
Merge pull request #20 from jestabro/filter-xml-files
T5194: filter on files of extension .xml
-rw-r--r--src/generate.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/generate.ml b/src/generate.ml
index 53ab35f..e7801c5 100644
--- a/src/generate.ml
+++ b/src/generate.ml
@@ -4,7 +4,10 @@ exception Write_error of string
let load_interface_definitions dir =
let open Reference_tree in
- let relative_paths = FileUtil.ls dir in
+ let dir_paths = FileUtil.ls dir in
+ let relative_paths =
+ List.filter (fun x -> Filename.extension x = ".xml") dir_paths
+ in
let absolute_paths =
try Ok (List.map Util.absolute_path relative_paths)
with Sys_error no_dir_msg -> Error no_dir_msg