Add private MEV embedded support
This commit is contained in:
+10
-6
@@ -1,11 +1,15 @@
|
||||
import std/os
|
||||
|
||||
template embeddedTranslationData*(name: static[string]): string =
|
||||
template translationDataPath(name: static[string], visibility: static[string]): string =
|
||||
const dataRoot = currentSourcePath().parentDir.parentDir / "data"
|
||||
const privatePath = dataRoot / "private" / (name & ".tsv")
|
||||
const publicPath = dataRoot / "public" / (name & ".tsv")
|
||||
dataRoot / visibility / (name & ".tsv")
|
||||
|
||||
when fileExists(privatePath):
|
||||
staticRead(privatePath)
|
||||
template hasEmbeddedTranslationData*(name: static[string]): bool =
|
||||
fileExists(translationDataPath(name, "private")) or
|
||||
fileExists(translationDataPath(name, "public"))
|
||||
|
||||
template embeddedTranslationData*(name: static[string]): string =
|
||||
when fileExists(translationDataPath(name, "private")):
|
||||
staticRead(translationDataPath(name, "private"))
|
||||
else:
|
||||
staticRead(publicPath)
|
||||
staticRead(translationDataPath(name, "public"))
|
||||
|
||||
Reference in New Issue
Block a user