@@ -138,17 +138,17 @@ impl Repository {
138
138
}
139
139
}
140
140
struct Gitpod {
141
- workspace_domain : String ,
142
- workspace_url : String ,
141
+ domain : String ,
142
+ url : String ,
143
143
}
144
144
145
145
impl Gitpod {
146
146
fn load ( ) -> Self {
147
- let workspace_url = std:: env:: var ( "GITPOD_WORKSPACE_URL" ) . unwrap ( ) ;
147
+ let workspace_url = std:: env:: var ( "GITPOD_WORKSPACE_URL" ) . expect ( "Not running in Gitpod" ) ;
148
148
149
149
Self {
150
- workspace_domain : workspace_url. replace ( "https://" , "8080-" ) ,
151
- workspace_url : workspace_url. replace ( "https://" , "https://8080-" ) ,
150
+ domain : workspace_url. replace ( "https://" , "8080-" ) ,
151
+ url : workspace_url. replace ( "https://" , "https://8080-" ) ,
152
152
}
153
153
}
154
154
@@ -224,8 +224,8 @@ fn setup(mut config: Config) -> std::io::Result<()> {
224
224
225
225
if Gitpod :: is_host ( ) {
226
226
let gitpod = Gitpod :: load ( ) ;
227
- config. lila_domain = Some ( gitpod. workspace_domain ) ;
228
- config. lila_url = Some ( gitpod. workspace_url ) ;
227
+ config. lila_domain = Some ( gitpod. domain ) ;
228
+ config. lila_url = Some ( gitpod. url ) ;
229
229
}
230
230
231
231
config. save ( ) ;
@@ -596,11 +596,11 @@ mod tests {
596
596
597
597
let gitpod = Gitpod :: load ( ) ;
598
598
assert_eq ! (
599
- gitpod. workspace_domain ,
599
+ gitpod. domain ,
600
600
"8080-lichessorg-liladocker-abc123.ws-us123.gitpod.io"
601
601
) ;
602
602
assert_eq ! (
603
- gitpod. workspace_url ,
603
+ gitpod. url ,
604
604
"https://8080-lichessorg-liladocker-abc123.ws-us123.gitpod.io"
605
605
) ;
606
606
}
0 commit comments