(ctx context.Context, name string, content *godog.DocString)
| 809 | } |
| 810 | |
| 811 | func 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 | |
| 830 | func createTrackBundleFile(ctx context.Context, name string, content *godog.DocString) (context.Context, error) { |
| 831 | return createGenericFile(ctx, name, content) |
no test coverage detected