Skip to content

Commit 98e270d

Browse files
committed
inserter.go に YAML 関連のをぶちこんだ
1 parent 0a355b4 commit 98e270d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/inserter/inserter.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
// Inserter - Inserter
1818
type Inserter struct {
1919
jsonInserter *JSONInserter
20+
yamlInserter *YAMLInserter
2021
jsInserter *JSInserter
2122
}
2223

@@ -26,6 +27,7 @@ func NewInserter(client *firestore.Client) *Inserter {
2627
return &Inserter{
2728
jsonInserter: NewJSONInserter(ci),
2829
jsInserter: NewJSInserter(ci),
30+
yamlInserter: NewYAMLInserter(ci),
2931
}
3032
}
3133

@@ -61,6 +63,12 @@ func (i *Inserter) executeFile(ctx context.Context) func(path string, info os.Fi
6163
if err != nil {
6264
log.Printf("failed to insert json file: %s\n%+v", path, err)
6365
}
66+
case strings.HasSuffix(path, ".yaml"):
67+
case strings.HasSuffix(path, ".yml"):
68+
err = i.yamlInserter.Execute(ctx, cn, path)
69+
if err != nil {
70+
log.Printf("failed to insert yaml file: %s\n%+v", path, err)
71+
}
6472
case strings.HasSuffix(path, ".js"):
6573
err = i.jsInserter.Execute(ctx, cn, path)
6674
if err != nil {

0 commit comments

Comments
 (0)