(ctx context.Context, cli *cli.Command)
| 509 | } |
| 510 | |
| 511 | func start(ctx context.Context, cli *cli.Command) error { |
| 512 | // if cleanup is requested, delete all existing status files(default) |
| 513 | if cleanupAllFlag { |
| 514 | // cleanup output directory and create again each time |
| 515 | err := os.RemoveAll(outputDirFlag) |
| 516 | if err != nil { |
| 517 | if !os.IsNotExist(err) { |
| 518 | return err |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | // create status directory |
| 524 | err := os.Mkdir(outputDirFlag, 0755) |
| 525 | if err != nil && !os.IsExist(err) { |
| 526 | return err |
| 527 | } |
| 528 | |
| 529 | return validateComponent(ctx, componentFlag) |
| 530 | } |
| 531 | |
| 532 | func validateComponent(ctx context.Context, componentFlag string) error { |
| 533 | switch componentFlag { |
nothing calls this directly
no test coverage detected