(cmd *cobra.Command, basePath string, relativeBasePath string, position int)
| 39 | } |
| 40 | |
| 41 | func NewTemplateInformation(cmd *cobra.Command, basePath string, relativeBasePath string, position int) *TemplateInformation { |
| 42 | fileName := strings.ReplaceAll(cmd.CommandPath(), " ", "-") |
| 43 | relativePath := filepath.Join(relativeBasePath, fileName) |
| 44 | currentTime := time.Now() |
| 45 | return &TemplateInformation{ |
| 46 | Title: cmd.CommandPath(), |
| 47 | Command: cmd, |
| 48 | Position: position, |
| 49 | OutputFile: filepath.Join(basePath, fileName) + ".mdx", |
| 50 | RelativePath: relativePath, |
| 51 | Date: fmt.Sprintf("%d-%02d-%02d", currentTime.Year(), currentTime.Month(), currentTime.Day()), |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | type Pages []*TemplateInformation |
| 56 |
no test coverage detected