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

Method preInstall

buildsystems/buildconfig_hooks.go:135–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133}
134
135func (b BuildConfig) preInstall() error {
136 for _, script := range b.PreInstall {
137 script = strings.TrimSpace(script)
138 if script == "" {
139 continue
140 }
141
142 title := fmt.Sprintf("[pre install %s]", b.PortConfig.nameVersion())
143 script = b.expandVariables(script)
144 if err := checkUnexpandedVariables(script, title); err != nil {
145 return err
146 }
147 executor := cmd.NewExecutor(title, script)
148
149 // prebuild port does not have repo dir.
150 if fileio.PathExists(b.PortConfig.RepoDir) {
151 executor.SetWorkDir(b.PortConfig.RepoDir)
152 }
153
154 if err := executor.Execute(); err != nil {
155 return err
156 }
157 }
158
159 return nil
160}
161
162func (b BuildConfig) postInstall() error {
163 for _, script := range b.PostInstall {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected