fix: fixes an error where stdin could not be used to create tasks (#444)
This commit is contained in:
parent
e39e365222
commit
77cca94cdc
@ -87,16 +87,7 @@ func newTaskCreateCmd() cli.Command {
|
||||
TasksApi: api.TasksApi,
|
||||
}
|
||||
|
||||
if len(fluxFile) > 0 {
|
||||
if len(scriptParams) > 0 {
|
||||
return errors.New("cannot specify script parameters when not using a script in the task")
|
||||
}
|
||||
var err error
|
||||
params.FluxQuery, err = clients.ReadQuery(fluxFile, ctx.Args())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if len(scriptID) > 0 {
|
||||
params.ScriptID = scriptID
|
||||
params.ScriptParams = make(map[string]interface{})
|
||||
|
||||
@ -105,7 +96,17 @@ func newTaskCreateCmd() cli.Command {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if len(scriptParams) > 0 {
|
||||
return errors.New("cannot specify script parameters when not using a script in the task")
|
||||
}
|
||||
var err error
|
||||
params.FluxQuery, err = clients.ReadQuery(fluxFile, ctx.Args())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return client.Create(getContext(ctx), ¶ms)
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user