this repo has no description smallweb.run
smallweb
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix handling of crons flag in smallweb cron

pomdtr 6a51da03 e78889b5

+18
+18
cmd/crons.go
··· 7 7 "io" 8 8 "log" 9 9 "os" 10 + "path/filepath" 10 11 "strings" 11 12 "time" 12 13 ··· 49 50 for _, appname := range k.MapKeys("apps") { 50 51 if len(args) > 0 && appname != args[0] { 51 52 continue 53 + } else if len(args) == 0 && !flags.all { 54 + cwd, err := os.Getwd() 55 + if err != nil { 56 + return fmt.Errorf("failed to get current directory: %w", err) 57 + } 58 + 59 + if !strings.HasPrefix(cwd, k.String("dir")) { 60 + return fmt.Errorf("not in an app directory") 61 + } 62 + appDir := cwd 63 + for filepath.Dir(appDir) != k.String("dir") { 64 + appDir = filepath.Dir(appDir) 65 + } 66 + 67 + if appname != filepath.Base(appDir) { 68 + continue 69 + } 52 70 } 53 71 54 72 for _, job := range k.Slices(fmt.Sprintf("apps.%s.crons", appname)) {