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
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,4 +5,5 @@ nimcache/
|
||||||
|
|
||||||
# Absolute paths
|
# Absolute paths
|
||||||
/src/babel
|
/src/babel
|
||||||
|
/src/nimble
|
||||||
/tests/tester
|
/tests/tester
|
||||||
|
|
|
||||||
|
|
@ -185,8 +185,10 @@ proc parseCmdLine(): TOptions =
|
||||||
if result.action.typ == ActionNil:
|
if result.action.typ == ActionNil:
|
||||||
writeHelp()
|
writeHelp()
|
||||||
|
|
||||||
# Rename deprecated babel dir.
|
# TODO: Remove this after a couple of versions.
|
||||||
renameBabelToNimble(result)
|
if getNimrodVersion() > newVersion("0.9.6"):
|
||||||
|
# Rename deprecated babel dir.
|
||||||
|
renameBabelToNimble(result)
|
||||||
|
|
||||||
# Load nimbledata.json
|
# Load nimbledata.json
|
||||||
let nimbledataFilename = result.getNimbleDir() / "nimbledata.json"
|
let nimbledataFilename = result.getNimbleDir() / "nimbledata.json"
|
||||||
|
|
@ -418,7 +420,7 @@ proc buildFromDir(pkgInfo: TPackageInfo, paths: seq[string]) =
|
||||||
for bin in pkgInfo.bin:
|
for bin in pkgInfo.bin:
|
||||||
echo("Building ", pkginfo.name, "/", bin, " using ", pkgInfo.backend,
|
echo("Building ", pkginfo.name, "/", bin, " using ", pkgInfo.backend,
|
||||||
" backend...")
|
" backend...")
|
||||||
doCmd(getNimBin() & " $# -d:release --noNimblePath $# \"$#\"" %
|
doCmd(getNimBin() & " $# -d:release --noBabelPath $# \"$#\"" %
|
||||||
[pkgInfo.backend, args, realDir / bin.changeFileExt("nim")])
|
[pkgInfo.backend, args, realDir / bin.changeFileExt("nim")])
|
||||||
|
|
||||||
proc saveNimbleMeta(pkgDestDir, url: string, filesInstalled: TSet[string]) =
|
proc saveNimbleMeta(pkgDestDir, url: string, filesInstalled: TSet[string]) =
|
||||||
|
|
@ -797,8 +799,6 @@ proc doAction(options: TOptions) =
|
||||||
assert false
|
assert false
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
# TODO: Check for .babel dir and rename everything to nimble.
|
|
||||||
|
|
||||||
when defined(release):
|
when defined(release):
|
||||||
try:
|
try:
|
||||||
parseCmdLine().doAction()
|
parseCmdLine().doAction()
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,17 @@
|
||||||
# BSD License. Look at license.txt for more info.
|
# BSD License. Look at license.txt for more info.
|
||||||
import parsecfg, streams, strutils, os
|
import parsecfg, streams, strutils, os
|
||||||
|
|
||||||
import tools
|
import tools, version
|
||||||
|
|
||||||
type
|
type
|
||||||
TConfig* = object
|
TConfig* = object
|
||||||
nimbleDir*: string
|
nimbleDir*: string
|
||||||
|
|
||||||
proc initConfig(): TConfig =
|
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 =
|
proc parseConfig*(): TConfig =
|
||||||
result = initConfig()
|
result = initConfig()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue