Skip to content

Commit f26c32f

Browse files
committed
Fix content empty on converter
1 parent e57393d commit f26c32f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

readers/psh_config.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,17 @@ func readConfigFile(node *yaml.Node, filePath string) {
3737
os.Exit(1)
3838
}
3939

40-
// Config node type.
41-
node.Kind = yaml.MappingNode
42-
node.Tag = TAG_MAP
40+
if sub_metamodel.Kind > 0 && len(sub_metamodel.Content) > 0 {
41+
// Config node type.
42+
node.Kind = yaml.MappingNode
43+
node.Tag = TAG_MAP
44+
45+
// Map to meta-model.
46+
node.Content = append(node.Content, sub_metamodel.Content[0].Content...)
47+
} else {
48+
fmt.Printf("No content to append from %s\n", filePath)
49+
}
4350

44-
// Map to meta-model.
45-
node.Content = append(node.Content, sub_metamodel.Content[0].Content...)
4651
} else {
4752
fmt.Printf("No content to append from %s\n", filePath)
4853
// Map to meta-model.

0 commit comments

Comments
 (0)