Add private MEV embedded support

This commit is contained in:
2026-06-14 08:14:27 -05:00
parent 544062902b
commit 42d2587704
6 changed files with 473 additions and 113 deletions
+10 -6
View File
@@ -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"))