File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -87,16 +87,7 @@ func newTaskCreateCmd() cli.Command {
8787 TasksApi : api .TasksApi ,
8888 }
8989
90- if len (fluxFile ) > 0 {
91- if len (scriptParams ) > 0 {
92- return errors .New ("cannot specify script parameters when not using a script in the task" )
93- }
94- var err error
95- params .FluxQuery , err = clients .ReadQuery (fluxFile , ctx .Args ())
96- if err != nil {
97- return err
98- }
99- } else {
90+ if len (scriptID ) > 0 {
10091 params .ScriptID = scriptID
10192 params .ScriptParams = make (map [string ]interface {})
10293
@@ -105,7 +96,17 @@ func newTaskCreateCmd() cli.Command {
10596 return err
10697 }
10798 }
99+ } else {
100+ if len (scriptParams ) > 0 {
101+ return errors .New ("cannot specify script parameters when not using a script in the task" )
102+ }
103+ var err error
104+ params .FluxQuery , err = clients .ReadQuery (fluxFile , ctx .Args ())
105+ if err != nil {
106+ return err
107+ }
108108 }
109+
109110 return client .Create (getContext (ctx ), & params )
110111 },
111112 }
You can’t perform that action at this time.
0 commit comments