buildIDConfigYAML returns the id: section for .taskmd.yaml. Returns empty string for the default sequential strategy.
(cfg idStrategyConfig)
| 656 | // buildIDConfigYAML returns the id: section for .taskmd.yaml. |
| 657 | // Returns empty string for the default sequential strategy. |
| 658 | func buildIDConfigYAML(cfg idStrategyConfig) string { |
| 659 | switch cfg.strategy { |
| 660 | case "prefixed": |
| 661 | return fmt.Sprintf("id:\n strategy: prefixed\n prefix: %s\n", cfg.prefix) |
| 662 | case "random": |
| 663 | return "id:\n strategy: random\n length: 6\n" |
| 664 | case "ulid": |
| 665 | return "id:\n strategy: ulid\n length: 9\n" |
| 666 | default: |
| 667 | return "" |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | // writeInitFiles writes files to a directory, returning created paths. |
| 672 | func writeInitFiles(dir string, files []fileToWrite, quiet bool) ([]string, error) { |
no outgoing calls