| 343 | } |
| 344 | |
| 345 | func (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 | |
| 364 | func (c *Celer) CreateProject(projectName string) error { |
| 365 | // Clean platform name. |