From 1db644bcf567cceee2ca3ba2bc746a8028cf2069 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 26 Dec 2023 20:20:20 +0100 Subject: up --- c_init.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/c_init.go b/c_init.go index e58e05d..e7d4f08 100644 --- a/c_init.go +++ b/c_init.go @@ -76,15 +76,16 @@ func c_recurse_data_dir(dir, root string, ldirs *DirsList, } ldirs.add_back(&dir_node) for _, file := range files { + filename := file.Name() if file.IsDir() == true { - c_recurse_data_dir(dir + file.Name() + "/", root, ldirs, + c_recurse_data_dir(dir + filename + "/", root, ldirs, id + 1, file.Name(), &dir_node, depth + 1) - } else if filepath.Ext(file.Name()) == ".yml" { - host := c_read_yaml_file(root + dir + file.Name()) + } else if filepath.Ext(filename) == ".yml" { + host := c_read_yaml_file(root + dir + filename) if host == nil { return } - host.Filename = file.Name() + host.Filename = filename host.Dir = &dir_node dir_node.lhost.add_back(host) } -- cgit v1.2.3