cmd/camtool: output server-config.json string

In addition to outputting the JSON config needed for cloudstorage_test,
also provide the colon-delimited string needed for server-config.json.

Also update URL for Google API Console

Fixes #715

Change-Id: I3784ad3442bcf0c99cb738a3beed7b9e5fbcac68
This commit is contained in:
Will Norris 2016-04-23 15:04:09 -07:00
parent 0c355a18cc
commit f82dc010bc
1 changed files with 3 additions and 2 deletions

View File

@ -105,7 +105,8 @@ func (c *googinitCmd) RunCommand(args []string) error {
"refresh_token": token.RefreshToken, "refresh_token": token.RefreshToken,
} }
enc.Encode(authObj) enc.Encode(authObj)
fmt.Fprint(cmdmain.Stdout, "\n") fmt.Fprint(cmdmain.Stdout, "\n\nFor server-config.json, your 'googlecloudstorage' value (update with your bucket name and path):\n\n")
fmt.Fprintf(cmdmain.Stdout, "%s:%s:%s:bucketName[/optional/dir]\n", clientId, clientSecret, token.RefreshToken)
return nil return nil
} }
@ -120,7 +121,7 @@ func prompt(promptText string) string {
// Prompt for client id / secret // Prompt for client id / secret
func getClientInfo() (string, string) { func getClientInfo() (string, string) {
fmt.Fprintf(cmdmain.Stdout, "Please provide the client id and client secret \n") fmt.Fprintf(cmdmain.Stdout, "Please provide the client id and client secret \n")
fmt.Fprintf(cmdmain.Stdout, "(You can find these at http://code.google.com/apis/console > your project > API Access)\n") fmt.Fprintf(cmdmain.Stdout, "(You can find these at https://console.developers.google.com/apis/credentials)\n")
var ( var (
clientId string clientId string
clientSecret string clientSecret string