MCPcopy Create free account
hub / github.com/celer-pkg/celer / preBuild

Method preBuild

buildsystems/buildconfig_hooks.go:81–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79}
80
81func (b BuildConfig) preBuild() error {
82 for _, script := range b.PreBuild {
83 script = strings.TrimSpace(script)
84 if script == "" {
85 continue
86 }
87
88 title := fmt.Sprintf("[pre build %s]", b.PortConfig.nameVersion())
89 script = b.expandVariables(script)
90 if err := checkUnexpandedVariables(script, title); err != nil {
91 return err
92 }
93 executor := cmd.NewExecutor(title, script)
94
95 // prebuild port does not have repo dir.
96 if fileio.PathExists(b.PortConfig.RepoDir) {
97 executor.SetWorkDir(b.PortConfig.RepoDir)
98 }
99
100 if err := executor.Execute(); err != nil {
101 return err
102 }
103 }
104
105 return nil
106}
107
108func (b BuildConfig) postBuild() error {
109 for _, script := range b.PostBuild {

Callers

nothing calls this directly

Calls 8

expandVariablesMethod · 0.95
NewExecutorFunction · 0.92
PathExistsFunction · 0.92
checkUnexpandedVariablesFunction · 0.85
SprintfMethod · 0.80
nameVersionMethod · 0.80
SetWorkDirMethod · 0.80
ExecuteMethod · 0.80

Tested by

no test coverage detected