Skip to content

Commit

Permalink
[patch] fixing js config file error
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfmurdock committed Sep 10, 2024
1 parent 0f387b4 commit dd299e2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package com.zegreatrob.tools.cli
import kotlin.js.json

private val fs = js("require('node:fs')")
actual fun readFromFile(fileName: String): String? =
actual fun readFromFile(fileName: String): String? = if (fs.existsSync(fileName).unsafeCast<Boolean>()) {
fs.readFileSync(fileName, json("encoding" to "utf-8"))
.unsafeCast<String>()
} else {
null
}

0 comments on commit dd299e2

Please sign in to comment.