File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ require (
2020 github.com/mattn/go-colorable v0.1.4
2121 github.com/mattn/go-isatty v0.0.11
2222 github.com/pkg/errors v0.9.1 // indirect
23- github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200331160105-1181c3dc1bcd
23+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200403105108-eb943ac1f1dc
2424 github.com/sergi/go-diff v1.0.0 // indirect
2525 github.com/spf13/cobra v0.0.5
2626 github.com/spf13/pflag v1.0.5 // indirect
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR
6161mygithub.libinneed.workers.dev/scaleway/scaleway-sdk-go v1.0.0-beta.6 h1:C1/pvkxkGN/H03mDxLzItaceYJDBk1HdClgR15suAzI =
6262mygithub.libinneed.workers.dev/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200331160105-1181c3dc1bcd h1:ICQFQOSIOyt5n1RxOCAg1rq+DFLunpJpAK2ttjdGhUU =
6363mygithub.libinneed.workers.dev/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200331160105-1181c3dc1bcd /go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8 =
64+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200403105108-eb943ac1f1dc h1:YJloAPPmGOEF+nufGL4a9Ppj6jnIMs8FjIorEM3ZBoE =
65+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200403105108-eb943ac1f1dc /go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8 =
6466mygithub.libinneed.workers.dev/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ =
6567mygithub.libinneed.workers.dev/sergi/go-diff v1.0.0 /go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo =
6668mygithub.libinneed.workers.dev/spf13/afero v1.1.2 /go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ =
Original file line number Diff line number Diff line change @@ -111,11 +111,11 @@ func generateRandNumber() string {
111111 return bigRand .String ()
112112}
113113
114- // IsTelemetryDisabled returns true when the Opt-In send_telemetry attribute in the config is set.
114+ // IsTelemetryDisabled returns false when the Opt-In send_telemetry attribute in the config is set.
115115func IsTelemetryDisabled () bool {
116116 config , err := scw .LoadConfig ()
117117 if err != nil {
118118 return false
119119 }
120- return ! config .SendTelemetry
120+ return config . SendTelemetry == nil || ! * config .SendTelemetry
121121}
Original file line number Diff line number Diff line change @@ -124,14 +124,10 @@ func initCommand() *core.Command {
124124
125125 // Check if a config exists
126126 // Actual creation of the new config is done in the Run()
127- newConfig := false
128127 config , err := scw .LoadConfig ()
129- if err != nil {
130- newConfig = true
131- }
132128
133129 // If it is not a new config, ask if we want to override the existing config
134- if ! newConfig {
130+ if err == nil && ! config . IsEmpty () {
135131 _ , _ = interactive .PrintlnWithoutIndent (`
136132 Current config is located at ` + scw .GetConfigPath () + `
137133 ` + terminal .Style (fmt .Sprint (config ), color .Faint ) + `
@@ -245,7 +241,7 @@ func initCommand() *core.Command {
245241 }
246242
247243 if args .SendTelemetry != nil {
248- config .SendTelemetry = * args .SendTelemetry
244+ config .SendTelemetry = args .SendTelemetry
249245 }
250246
251247 // Update active profile
You can’t perform that action at this time.
0 commit comments