diff options
author | Joe <rbo@gmx.us> | 2023-12-26 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-26 20:20:20 +0100 |
commit | 1db644bcf567cceee2ca3ba2bc746a8028cf2069 (patch) | |
tree | fdc2734232df77e17a55ce852b806c02b08b6611 /c_init.go | |
parent | up (diff) | |
download | hardflip-1db644bcf567cceee2ca3ba2bc746a8028cf2069.tar.gz hardflip-1db644bcf567cceee2ca3ba2bc746a8028cf2069.tar.bz2 hardflip-1db644bcf567cceee2ca3ba2bc746a8028cf2069.tar.xz hardflip-1db644bcf567cceee2ca3ba2bc746a8028cf2069.tar.zst hardflip-1db644bcf567cceee2ca3ba2bc746a8028cf2069.zip |
up
Diffstat (limited to 'c_init.go')
-rw-r--r-- | c_init.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) } |