Skip to content

Commit 2b230c6

Browse files
committed
fix: property lazy initialization
1 parent c460202 commit 2b230c6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/kotlin/com/coder/toolbox/CoderToolboxContext.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ data class CoderToolboxContext(
3333
* 3. CODER_URL.
3434
* 4. URL in global cli config.
3535
*/
36-
val deploymentUrl: Pair<String, SettingSource>? = this.secrets.lastDeploymentURL.let {
37-
if (it.isNotBlank()) {
38-
it to SettingSource.LAST_USED
39-
} else {
40-
this.settingsStore.defaultURL()
36+
val deploymentUrl: Pair<String, SettingSource>?
37+
get() = this.secrets.lastDeploymentURL.let {
38+
if (it.isNotBlank()) {
39+
it to SettingSource.LAST_USED
40+
} else {
41+
this.settingsStore.defaultURL()
42+
}
4143
}
42-
}
4344

4445
/**
4546
* Try to find a token.

0 commit comments

Comments
 (0)