()
| 187 | } |
| 188 | |
| 189 | func (b BuildConfig) fixBuild() error { |
| 190 | for _, script := range b.FixBuild { |
| 191 | script = strings.TrimSpace(script) |
| 192 | if script == "" { |
| 193 | continue |
| 194 | } |
| 195 | |
| 196 | title := fmt.Sprintf("[fix build %s]", b.PortConfig.nameVersion()) |
| 197 | script = b.expandVariables(script) |
| 198 | if err := checkUnexpandedVariables(script, title); err != nil { |
| 199 | return err |
| 200 | } |
| 201 | executor := cmd.NewExecutor(title, script) |
| 202 | executor.SetWorkDir(b.PortConfig.RepoDir) |
| 203 | executor.MSYS2Env(runtime.GOOS == "windows") |
| 204 | if err := executor.Execute(); err != nil { |
| 205 | return err |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | return nil |
| 210 | } |
| 211 | |
| 212 | // checkUnexpandedVariables checks if there are any unexpanded variables in the script. |
| 213 | // It looks for patterns like ${VAR_NAME} or $VAR_NAME that weren't expanded. |
nothing calls this directly
no test coverage detected