Fixes #54.
This commit is contained in:
parent
536cf4d1cc
commit
39fcd3a89f
2 changed files with 10 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import tools, version
|
|||
type
|
||||
TConfig* = object
|
||||
nimbleDir*: string
|
||||
chcp*: bool # Whether to change the code page in .cmd files on Win.
|
||||
|
||||
proc initConfig(): TConfig =
|
||||
if getNimrodVersion() > newVersion("0.9.6"):
|
||||
|
|
@ -14,6 +15,8 @@ proc initConfig(): TConfig =
|
|||
else:
|
||||
result.nimbleDir = getHomeDir() / ".babel"
|
||||
|
||||
result.chcp = true
|
||||
|
||||
proc parseConfig*(): TConfig =
|
||||
result = initConfig()
|
||||
var confFile = getConfigDir() / "nimble" / "nimble.ini"
|
||||
|
|
@ -42,6 +45,8 @@ proc parseConfig*(): TConfig =
|
|||
# Ensure we don't restore the deprecated nimble dir.
|
||||
if e.value != getHomeDir() / ".babel":
|
||||
result.nimbleDir = e.value
|
||||
of "chcp":
|
||||
result.chcp = parseBool(e.value)
|
||||
else:
|
||||
raise newException(ENimble, "Unable to parse config file:" &
|
||||
" Unknown key: " & e.key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue