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

Method CreatePort

configs/celer.go:383–400  ·  view source on GitHub ↗
(nameVersion string)

Source from the content-addressed store, hash-verified

381}
382
383func (c *Celer) CreatePort(nameVersion string) error {
384 parts := strings.Split(nameVersion, "@")
385 if len(parts) != 2 {
386 return fmt.Errorf("invalid port name version")
387 }
388
389 portDir := dirs.GetPortDir(parts[0], parts[1])
390 if err := os.MkdirAll(portDir, os.ModePerm); err != nil {
391 return err
392 }
393
394 var port Port
395 portPath := filepath.Join(portDir, "port.toml")
396 if err := port.Write(portPath); err != nil {
397 return err
398 }
399 return nil
400}
401
402func (c *Celer) CloneConf(url, branch string, force bool) error {
403 if err := buildtools.CheckTools(c, "git"); err != nil {

Callers 1

createPortMethod · 0.80

Calls 3

WriteMethod · 0.95
GetPortDirFunction · 0.92
MkdirAllMethod · 0.80

Tested by

no test coverage detected