mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
fix: add missing cron:set command
The code existed but somehow it wasn't exposed as a command. Closes #6655
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
> New as of 0.23.0
|
||||
|
||||
```
|
||||
cron:list <app> [--format json|stdout] # List scheduled cron tasks for an app
|
||||
cron:report [<app>] [<flag>] # Display report about an app
|
||||
cron:run <app> <cron_id> [--detach] # Run a cron task on the fly
|
||||
cron:list <app> [--format json|stdout] # List scheduled cron tasks for an app
|
||||
cron:report [<app>] [<flag>] # Display report about an app
|
||||
cron:run <app> <cron_id> [--detach] # Run a cron task on the fly
|
||||
cron:set [--global|<app>] <key> <value> # Set or clear a cron property for an app
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
SUBCOMMANDS = subcommands/list subcommands/report subcommands/run
|
||||
SUBCOMMANDS = subcommands/list subcommands/report subcommands/run subcommands/set
|
||||
TRIGGERS = triggers/cron-get-property
|
||||
BUILD = commands subcommands triggers
|
||||
PLUGIN_NAME = cron
|
||||
|
||||
@@ -20,7 +20,8 @@ Additional commands:`
|
||||
helpContent = `
|
||||
cron:list <app> [--format json|stdout], List scheduled cron tasks for an app
|
||||
cron:report [<app>] [<flag>], Display report about an app
|
||||
cron:run <app> <cron_id> [--detach], Run a cron task on the fly`
|
||||
cron:run <app> <cron_id> [--detach], Run a cron task on the fly
|
||||
cron:set [--global|<app>] <key> <value>, Set or clear a cron property for an app`
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -40,6 +40,19 @@ func main() {
|
||||
appName := args.Arg(0)
|
||||
cronID := args.Arg(1)
|
||||
err = cron.CommandRun(appName, cronID, *detached)
|
||||
case "set":
|
||||
args := flag.NewFlagSet("cron:set", flag.ExitOnError)
|
||||
global := args.Bool("global", false, "--global: set a global property")
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
property := args.Arg(1)
|
||||
value := args.Arg(2)
|
||||
if *global {
|
||||
appName = "--global"
|
||||
property = args.Arg(0)
|
||||
value = args.Arg(1)
|
||||
}
|
||||
err = cron.CommandSet(appName, property, value)
|
||||
default:
|
||||
err = fmt.Errorf("Invalid plugin subcommand call: %s", subcommand)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user