mirror of
https://github.com/codex-storage/nim-leveldb.git
synced 2025-02-21 03:48:10 +00:00
Merge pull request #14 from xyb/metaversion
read version from nimble config file
This commit is contained in:
commit
93ec50aede
@ -19,11 +19,19 @@ type
|
|||||||
LevelDbException* = object of Exception
|
LevelDbException* = object of Exception
|
||||||
|
|
||||||
const
|
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)
|
levelDbTrue = uint8(1)
|
||||||
levelDbFalse = uint8(0)
|
levelDbFalse = uint8(0)
|
||||||
|
|
||||||
version* = "0.3.0"
|
|
||||||
|
|
||||||
proc free(p: pointer) {.importc.}
|
proc free(p: pointer) {.importc.}
|
||||||
|
|
||||||
proc checkError(errPtr: cstring) =
|
proc checkError(errPtr: cstring) =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user