()
| 160 | } |
| 161 | |
| 162 | func (b BuildConfig) postInstall() error { |
| 163 | for _, script := range b.PostInstall { |
| 164 | script = strings.TrimSpace(script) |
| 165 | if script == "" { |
| 166 | continue |
| 167 | } |
| 168 | |
| 169 | title := fmt.Sprintf("[post install %s]", b.PortConfig.nameVersion()) |
| 170 | script = b.expandVariables(script) |
| 171 | if err := checkUnexpandedVariables(script, title); err != nil { |
| 172 | return err |
| 173 | } |
| 174 | executor := cmd.NewExecutor(title, script) |
| 175 | |
| 176 | // prebuild port does not have repo dir. |
| 177 | if fileio.PathExists(b.PortConfig.RepoDir) { |
| 178 | executor.SetWorkDir(b.PortConfig.RepoDir) |
| 179 | } |
| 180 | |
| 181 | if err := executor.Execute(); err != nil { |
| 182 | return err |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | return nil |
| 187 | } |
| 188 | |
| 189 | func (b BuildConfig) fixBuild() error { |
| 190 | for _, script := range b.FixBuild { |
nothing calls this directly
no test coverage detected