MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / slugify

Function slugify

cmd/dash.go:1064–1072  ·  view source on GitHub ↗

Helper function to slugify a string for filenames

(s string)

Source from the content-addressed store, hash-verified

1062
1063// Helper function to slugify a string for filenames
1064func slugify(s string) string {
1065 // Convert to lowercase
1066 s = strings.ToLower(s)
1067 // Replace spaces with hyphens
1068 s = strings.ReplaceAll(s, " ", "-")
1069 // Remove any non-alphanumeric characters
1070 s = regexp.MustCompile(`[^a-z0-9-]`).ReplaceAllString(s, "")
1071 return s
1072}
1073
1074// Helper function to add a line to a crontab file
1075func addLineToCrontab(file string, line string) error {

Callers 1

handlePostJobFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected