()
| 106 | } |
| 107 | |
| 108 | func (b BuildConfig) postBuild() error { |
| 109 | for _, script := range b.PostBuild { |
| 110 | script = strings.TrimSpace(script) |
| 111 | if script == "" { |
| 112 | continue |
| 113 | } |
| 114 | |
| 115 | title := fmt.Sprintf("[post build %s]", b.PortConfig.nameVersion()) |
| 116 | script = b.expandVariables(script) |
| 117 | if err := checkUnexpandedVariables(script, title); err != nil { |
| 118 | return err |
| 119 | } |
| 120 | executor := cmd.NewExecutor(title, script) |
| 121 | |
| 122 | // prebuild port does not have repo dir. |
| 123 | if fileio.PathExists(b.PortConfig.RepoDir) { |
| 124 | executor.SetWorkDir(b.PortConfig.RepoDir) |
| 125 | } |
| 126 | |
| 127 | if err := executor.Execute(); err != nil { |
| 128 | return err |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | return nil |
| 133 | } |
| 134 | |
| 135 | func (b BuildConfig) preInstall() error { |
| 136 | for _, script := range b.PreInstall { |
nothing calls this directly
no test coverage detected