Check Nim version to determine Nimble dir.
This commit is contained in:
parent
6ddfdb8c77
commit
e3cbc13568
3 changed files with 11 additions and 7 deletions
|
|
@ -2,14 +2,17 @@
|
|||
# BSD License. Look at license.txt for more info.
|
||||
import parsecfg, streams, strutils, os
|
||||
|
||||
import tools
|
||||
import tools, version
|
||||
|
||||
type
|
||||
TConfig* = object
|
||||
nimbleDir*: string
|
||||
|
||||
proc initConfig(): TConfig =
|
||||
result.nimbleDir = getHomeDir() / ".nimble"
|
||||
if getNimrodVersion() > newVersion("0.9.6"):
|
||||
result.nimbleDir = getHomeDir() / ".nimble"
|
||||
else:
|
||||
result.nimbleDir = getHomeDir() / ".babel"
|
||||
|
||||
proc parseConfig*(): TConfig =
|
||||
result = initConfig()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue