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

Method CreatePlatform

configs/celer.go:345–362  ·  view source on GitHub ↗
(platformName string)

Source from the content-addressed store, hash-verified

343}
344
345func (c *Celer) CreatePlatform(platformName string) error {
346 // Clean platform name.
347 platformName = strings.TrimSpace(platformName)
348 platformName = strings.TrimSuffix(platformName, ".toml")
349
350 if platformName == "" {
351 return fmt.Errorf("platform name is empty")
352 }
353
354 // Create platform file.
355 platformPath := filepath.Join(dirs.ConfPlatformsDir, platformName+".toml")
356 var platform Platform
357 if err := platform.Write(platformPath); err != nil {
358 return err
359 }
360
361 return nil
362}
363
364func (c *Celer) CreateProject(projectName string) error {
365 // Clean platform name.

Callers 1

createPlatformMethod · 0.80

Calls 1

WriteMethod · 0.95

Tested by

no test coverage detected