MCPcopy Create free account
hub / github.com/nhost/nhost / initInit

Function initInit

cli/cmd/project/init.go:117–140  ·  view source on GitHub ↗
(ps *clienv.PathStructure)

Source from the content-addressed store, hash-verified

115}
116
117func 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
142func initFolders(ps *clienv.PathStructure) error {
143 folders := []string{

Callers 2

commandInitFunction · 0.85
InitRemoteFunction · 0.85

Calls 7

MarshalFileFunction · 0.92
initFoldersFunction · 0.85
writeFSFunction · 0.85
HasuraConfigMethod · 0.80
ErrorfMethod · 0.80
RootMethod · 0.80
NhostFolderMethod · 0.80

Tested by

no test coverage detected