feat: add the ability to specify a custom mailto for all cron output

This commit is contained in:
Jose Diaz-Gonzalez
2023-08-19 23:59:00 -04:00
parent a433508fb1
commit c23e878e7d
12 changed files with 187 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
}
flags := map[string]common.ReportFunc{
"--cron-mailto": reportMailto,
"--cron-task-count": reportTasks,
}
@@ -27,6 +28,10 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
return common.ReportSingleApp("cron", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
}
func reportMailto(_ string) string {
return common.PropertyGet("cron", "--global", "mailto")
}
func reportTasks(appName string) string {
c, _ := FetchCronEntries(appName)
return strconv.Itoa(len(c))