File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -38,20 +38,22 @@ func main() {
3838 os .Exit (exitCode )
3939}
4040
41- func mainNoExit () int {
41+ func getConfigProfile () * scw. Profile {
4242 config , err := scw .LoadConfig ()
4343 if err != nil {
44- // handle error
45- log .Fatal (err )
44+ return & scw.Profile {}
4645 }
47- activeProfile , err := config .GetActiveProfile ()
46+ profile , err := config .GetActiveProfile ()
4847 if err != nil {
49- // handle error
50- log .Fatal (err )
48+ return & scw.Profile {}
5149 }
50+ return profile
51+ }
5252
53+ func mainNoExit () int {
54+ configProfile := getConfigProfile ()
5355 envProfile := scw .LoadEnvProfile ()
54- profile := scw .MergeProfiles (activeProfile , envProfile )
56+ profile := scw .MergeProfiles (configProfile , envProfile )
5557
5658 client , err := scw .NewClient (
5759 scw .WithProfile (profile ),
You can’t perform that action at this time.
0 commit comments