(ps *clienv.PathStructure)
| 115 | } |
| 116 | |
| 117 | func initInit(ps *clienv.PathStructure) error { |
| 118 | hasuraConf := map[string]any{"version": hasuraMetadataVersion} |
| 119 | if err := clienv.MarshalFile(hasuraConf, ps.HasuraConfig(), yaml.Marshal); err != nil { |
| 120 | return fmt.Errorf("failed to save hasura config: %w", err) |
| 121 | } |
| 122 | |
| 123 | if err := initFolders(ps); err != nil { |
| 124 | return err |
| 125 | } |
| 126 | |
| 127 | if err := writeFS(embeddedFS, "templates/init", ps.Root()); err != nil { |
| 128 | return fmt.Errorf("failed to write project files: %w", err) |
| 129 | } |
| 130 | |
| 131 | if err := writeFS( |
| 132 | emailtemplates.FS, |
| 133 | ".", |
| 134 | filepath.Join(ps.NhostFolder(), "emails"), |
| 135 | ); err != nil { |
| 136 | return fmt.Errorf("failed to write email templates: %w", err) |
| 137 | } |
| 138 | |
| 139 | return nil |
| 140 | } |
| 141 | |
| 142 | func initFolders(ps *clienv.PathStructure) error { |
| 143 | folders := []string{ |
no test coverage detected