MCPcopy
hub / github.com/perkeep/perkeep / build

Function build

dev/devcam/devcam.go:237–264  ·  view source on GitHub ↗

build builds the named perkeep targets. Each target may have its "perkeep.org" prefix removed.

(targets ...string)

Source from the content-addressed store, hash-verified

235// build builds the named perkeep targets.
236// Each target may have its "perkeep.org" prefix removed.
237func build(targets ...string) error {
238 if v, _ := strconv.ParseBool(os.Getenv("CAMLI_FAST_DEV")); v {
239 // Demo mode. See dev/demo.sh.
240 return nil
241 }
242 var fullTargets []string
243 for _, t := range targets {
244 t = filepath.ToSlash(t)
245 if !strings.HasPrefix(t, "perkeep.org") {
246 t = pathpkg.Join("perkeep.org", t)
247 }
248 fullTargets = append(fullTargets, t)
249 }
250 targetsComma := strings.Join(fullTargets, ",")
251 args := []string{
252 "run", "make.go",
253 "--quiet",
254 "--race=" + strconv.FormatBool(*race),
255 "--targets=" + targetsComma,
256 }
257 cmd := exec.Command("go", args...)
258 cmd.Stdout = os.Stdout
259 cmd.Stderr = os.Stderr
260 if err := cmd.Run(); err != nil {
261 return fmt.Errorf("error building %v: %v", targetsComma, err)
262 }
263 return nil
264}
265
266func main() {
267 cmdmain.PostFlag = func() {

Callers 5

RunCommandMethod · 0.70
RunCommandMethod · 0.70
RunCommandMethod · 0.70
RunCommandMethod · 0.70
RunCommandMethod · 0.70

Calls 3

HasPrefixMethod · 0.80
CommandMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected