Merge pull request #14 from xyb/metaversion

read version from nimble config file
This commit is contained in:
Michał Zieliński 2020-02-22 17:49:52 +01:00 committed by GitHub
commit 93ec50aede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,11 +19,19 @@ type
LevelDbException* = object of Exception
const
version* = block:
let content = staticRead"../leveldb.nimble"
var version_line: string
for line in content.split("\L"):
if line.startsWith("version"):
version_line = line
break
let raw = version_line.split("=", maxsplit = 1)[1]
raw.strip().strip(chars = {'"'})
levelDbTrue = uint8(1)
levelDbFalse = uint8(0)
version* = "0.3.0"
proc free(p: pointer) {.importc.}
proc checkError(errPtr: cstring) =