Skip to content

Commit

Permalink
En ørliten env-variabel for å si hvor filene er
Browse files Browse the repository at this point in the history
Co-authored-by: David Steinsland <[email protected]>
  • Loading branch information
fraadsbrandth and davidsteinsland committed Aug 26, 2024
1 parent 6126c7c commit aab22ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filbackend/src/main/kotlin/Filsluse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import java.util.UUID

object Filsluse {
private fun String.innhold() = File(this).takeIf { it.exists() }?.readText()
private fun spannerRoot() = "${System.getenv("HOME")}/.spanner"
private fun spannerRoot() = System.getenv("SPANNER_ROOT").takeUnless { it.isNullOrBlank() } ?: "${System.getenv("HOME")}/.spanner"
fun UUID.finnPerson() = "${spannerRoot()}/personer/$this.json".innhold()
fun UUID.finnHendelse() = "${spannerRoot()}/hendelser/$this.json".innhold()
}

0 comments on commit aab22ab

Please sign in to comment.