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

Method preConfigure

buildsystems/buildconfig_hooks.go:25–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25func (b BuildConfig) preConfigure() error {
26 for _, script := range b.PreConfigure {
27 script = strings.TrimSpace(script)
28 if script == "" {
29 continue
30 }
31
32 title := fmt.Sprintf("[pre configure %s]", b.PortConfig.nameVersion())
33 script = b.expandVariables(script)
34 if err := checkUnexpandedVariables(script, title); err != nil {
35 return err
36 }
37 executor := cmd.NewExecutor(title, script)
38
39 // prebuild port does not have repo dir.
40 if fileio.PathExists(b.PortConfig.RepoDir) {
41 executor.SetWorkDir(b.PortConfig.RepoDir)
42 }
43
44 executor.MSYS2Env(runtime.GOOS == "windows")
45 if err := executor.Execute(); err != nil {
46 return err
47 }
48 }
49
50 return nil
51}
52
53func (b BuildConfig) postConfigure() error {
54 for _, script := range b.PostConfigure {

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected