~emersion/hut

0185135be514f389114f84644383b65e9c7ccb4e — Simon Ser 6 months ago 1008997 v0.4.0
Fix panic when access-token-cmd returns an empty string
1 files changed, 6 insertions(+), 1 deletions(-)

M client.go
M client.go => client.go +6 -1
@@ 64,7 64,12 @@ func createClientWithInstance(service string, cmd *cobra.Command, instanceName s
			log.Fatalf("could not execute access-token-cmd: %v", err)
		}

		token = strings.Fields(string(output))[0]
		fields := strings.Fields(string(output))
		if len(fields) == 0 {
			log.Fatalf("access-token-cmd did not return a token")
		}

		token = fields[0]
	} else {
		token = inst.AccessToken
	}