MCPcopy Create free account
hub / github.com/conforma/cli / createGenericFile

Function createGenericFile

acceptance/cli/cli.go:811–828  ·  view source on GitHub ↗
(ctx context.Context, name string, content *godog.DocString)

Source from the content-addressed store, hash-verified

809}
810
811func createGenericFile(ctx context.Context, name string, content *godog.DocString) (context.Context, error) {
812 ctx, _, vars, err := variables(ctx)
813 if err != nil {
814 return ctx, err
815 }
816
817 expand := func(text string) string {
818 return os.Expand(text, func(key string) string {
819 return vars[key]
820 })
821 }
822
823 file := expand(name)
824
825 data := expand(content.Content)
826
827 return ctx, os.WriteFile(file, []byte(data), 0o600)
828}
829
830func createTrackBundleFile(ctx context.Context, name string, content *godog.DocString) (context.Context, error) {
831 return createGenericFile(ctx, name, content)

Callers 1

createTrackBundleFileFunction · 0.85

Calls 1

variablesFunction · 0.85

Tested by

no test coverage detected