()
| 23 | } |
| 24 | |
| 25 | func (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 | |
| 53 | func (b BuildConfig) postConfigure() error { |
| 54 | for _, script := range b.PostConfigure { |
nothing calls this directly
no test coverage detected