File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,28 @@ func init() {
18
18
runnerCmd .AddCommand (runnerRegisterCmd )
19
19
}
20
20
21
- func registerRunner () {
21
+ func initRunnerRegistrationToken () {
22
+ if ! runnerRegisterArgs .stdinRegistrationToken {
23
+ return
24
+ }
22
25
23
- configFile := util .ConfigInit (persistentFlags .configPath , persistentFlags .noConfig )
26
+ tokenBytes , err := io .ReadAll (os .Stdin )
27
+ if err != nil {
28
+ panic (err )
29
+ }
24
30
25
- if runnerRegisterArgs .stdinRegistrationToken {
26
- tokenBytes , err := io .ReadAll (os .Stdin )
27
- if err != nil {
28
- panic (err )
29
- }
31
+ if len (tokenBytes ) == 0 {
32
+ panic ("Empty token" )
33
+ }
30
34
31
- if len (tokenBytes ) == 0 {
32
- panic ("Empty token" )
33
- }
35
+ util .Config .Runner .RegistrationToken = strings .TrimSpace (string (tokenBytes ))
36
+ }
34
37
35
- util .Config .Runner .RegistrationToken = strings .TrimSpace (string (tokenBytes ))
36
- }
38
+ func registerRunner () {
39
+
40
+ configFile := util .ConfigInit (persistentFlags .configPath , persistentFlags .noConfig )
41
+
42
+ initRunnerRegistrationToken ()
37
43
38
44
taskPool := createRunnerJobPool ()
39
45
You can’t perform that action at this time.
0 commit comments