File tree 3 files changed +15
-6
lines changed
3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,13 @@ impl Config {
83
83
match profile {
84
84
Some ( profile) => self . profiles . get ( profile) . cloned ( ) ,
85
85
None => match ( self . api_token . clone ( ) , self . url . clone ( ) ) {
86
- ( Some ( api_token) , Some ( url) ) => Some ( Credentials { api_token, url } ) ,
86
+ ( Some ( api_token) , Some ( url) ) => Some ( Credentials {
87
+ api_token,
88
+ url : Some ( url) ,
89
+ } ) ,
87
90
( Some ( api_token) , _) => Some ( Credentials {
88
91
api_token,
89
- url : "https://api.edgee.app" . to_string ( ) ,
92
+ url : Some ( "https://api.edgee.app" . to_string ( ) ) ,
90
93
} ) ,
91
94
_ => None ,
92
95
} ,
@@ -100,7 +103,7 @@ impl Config {
100
103
}
101
104
None => {
102
105
self . api_token = Some ( creds. api_token ) ;
103
- self . url = Some ( creds. url ) ;
106
+ self . url = creds. url ;
104
107
}
105
108
}
106
109
}
@@ -121,6 +124,7 @@ impl<S: State> ConnectBuilder<S> {
121
124
{
122
125
let api_token = creds. api_token . clone ( ) ;
123
126
let url = creds. url . clone ( ) ;
124
- self . baseurl ( url. clone ( ) . as_str ( ) ) . api_token ( api_token)
127
+ self . baseurl ( url. unwrap_or ( "https://api.edgee.app" . to_string ( ) ) )
128
+ . api_token ( api_token)
125
129
}
126
130
}
Original file line number Diff line number Diff line change @@ -52,7 +52,10 @@ pub async fn run(opts: Options) -> Result<()> {
52
52
}
53
53
} ;
54
54
55
- let creds = Credentials { api_token, url } ;
55
+ let creds = Credentials {
56
+ api_token,
57
+ url : Some ( url) ,
58
+ } ;
56
59
57
60
let client = edgee_api_client:: new ( ) . credentials ( & creds) . connect ( ) ;
58
61
let user = client
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ pub async fn run(opts: Options) -> anyhow::Result<()> {
37
37
println ! ( " ID: {}" , user. id) ;
38
38
println ! ( " Name: {}" , user. name) ;
39
39
println ! ( " Email: {}" , user. email) ;
40
- println ! ( " Url: {}" , creds. url) ;
40
+ if let Some ( url) = & creds. url {
41
+ println ! ( " Url: {}" , url) ;
42
+ }
41
43
if let Some ( profile) = opts. profile {
42
44
println ! ( " Profile: {}" , profile) ;
43
45
}
You can’t perform that action at this time.
0 commit comments