MCPcopy Index your code
hub / github.com/commitdev/zero / CreateProjectConfigFile

Function CreateProjectConfigFile

internal/config/projectconfig/init.go:36–50  ·  view source on GitHub ↗

CreateProjectConfigFile extracts the required content for zero project config file then write to disk.

(dir string, projectName string, projectContext *ZeroProjectConfig)

Source from the content-addressed store, hash-verified

34
35// CreateProjectConfigFile extracts the required content for zero project config file then write to disk.
36func CreateProjectConfigFile(dir string, projectName string, projectContext *ZeroProjectConfig) error {
37 content, err := getProjectFileContent(*projectContext)
38 if err != nil {
39 return err
40 }
41
42 filePath := path.Join(dir, projectName, constants.ZeroProjectYml)
43 flog.Debugf("Project file path: %s", filePath)
44 writeErr := ioutil.WriteFile(filePath, []byte(content), 0644)
45 if writeErr != nil {
46 return err
47 }
48
49 return nil
50}
51
52func getProjectFileContent(projectConfig ZeroProjectConfig) (string, error) {
53 var tplBuffer bytes.Buffer

Callers 2

init.goFile · 0.92

Calls 2

DebugfFunction · 0.92
getProjectFileContentFunction · 0.85

Tested by 1