mirror of
https://github.com/logos-storage/nim-leveldb.git
synced 2026-01-07 16:13:07 +00:00
fix package compile issue
Error message: "Error: cannot open file: ../leveldb.nimble"
This commit is contained in:
parent
ba45990676
commit
713b036f98
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
nimcache/
|
||||
/test.db/
|
||||
/leveldb.e
|
||||
tests/packagetest/packagetest
|
||||
src/leveldb
|
||||
tests/test
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import options, strutils, leveldbpkg/raw
|
||||
import options, os, strutils, leveldbpkg/raw
|
||||
|
||||
type
|
||||
LevelDb* = ref object
|
||||
@ -20,7 +20,15 @@ type
|
||||
|
||||
const
|
||||
version* = block:
|
||||
let content = staticRead"../leveldb.nimble"
|
||||
const configFile = "leveldb.nimble"
|
||||
const sourcePath = currentSourcePath()
|
||||
const parentConfig = sourcePath.parentDir.parentDir / configFile
|
||||
const localConfig = sourcePath.parentDir / configFile
|
||||
var content: string
|
||||
if fileExists(parentConfig):
|
||||
content = staticRead(parentConfig)
|
||||
else:
|
||||
content = staticRead(localConfig)
|
||||
var version_line: string
|
||||
for line in content.split("\L"):
|
||||
if line.startsWith("version"):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user