File tree 4 files changed +7
-9
lines changed
4 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ require (
20
20
github.com/mattn/go-colorable v0.1.4
21
21
github.com/mattn/go-isatty v0.0.11
22
22
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
24
24
github.com/sergi/go-diff v1.0.0 // indirect
25
25
github.com/spf13/cobra v0.0.5
26
26
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
61
61
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6 h1:C1/pvkxkGN/H03mDxLzItaceYJDBk1HdClgR15suAzI =
62
62
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200331160105-1181c3dc1bcd h1:ICQFQOSIOyt5n1RxOCAg1rq+DFLunpJpAK2ttjdGhUU =
63
63
github.com/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 =
64
66
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ =
65
67
github.com/sergi/go-diff v1.0.0 /go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo =
66
68
github.com/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 {
111
111
return bigRand .String ()
112
112
}
113
113
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.
115
115
func IsTelemetryDisabled () bool {
116
116
config , err := scw .LoadConfig ()
117
117
if err != nil {
118
118
return false
119
119
}
120
- return ! config .SendTelemetry
120
+ return config . SendTelemetry == nil || ! * config .SendTelemetry
121
121
}
Original file line number Diff line number Diff line change @@ -124,14 +124,10 @@ func initCommand() *core.Command {
124
124
125
125
// Check if a config exists
126
126
// Actual creation of the new config is done in the Run()
127
- newConfig := false
128
127
config , err := scw .LoadConfig ()
129
- if err != nil {
130
- newConfig = true
131
- }
132
128
133
129
// 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 () {
135
131
_ , _ = interactive .PrintlnWithoutIndent (`
136
132
Current config is located at ` + scw .GetConfigPath () + `
137
133
` + terminal .Style (fmt .Sprint (config ), color .Faint ) + `
@@ -245,7 +241,7 @@ func initCommand() *core.Command {
245
241
}
246
242
247
243
if args .SendTelemetry != nil {
248
- config .SendTelemetry = * args .SendTelemetry
244
+ config .SendTelemetry = args .SendTelemetry
249
245
}
250
246
251
247
// Update active profile
You can’t perform that action at this time.
0 commit comments