diff --git a/.gitignore b/.gitignore index bf65b42..bd1ebed 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ nimcache/ # Absolute paths /src/babel +/src/nimble /tests/tester diff --git a/src/nimble.nim b/src/nimble.nim index 8a96312..d6ffd04 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -185,8 +185,10 @@ proc parseCmdLine(): TOptions = if result.action.typ == ActionNil: writeHelp() - # Rename deprecated babel dir. - renameBabelToNimble(result) + # TODO: Remove this after a couple of versions. + if getNimrodVersion() > newVersion("0.9.6"): + # Rename deprecated babel dir. + renameBabelToNimble(result) # Load nimbledata.json let nimbledataFilename = result.getNimbleDir() / "nimbledata.json" @@ -418,7 +420,7 @@ proc buildFromDir(pkgInfo: TPackageInfo, paths: seq[string]) = for bin in pkgInfo.bin: echo("Building ", pkginfo.name, "/", bin, " using ", pkgInfo.backend, " backend...") - doCmd(getNimBin() & " $# -d:release --noNimblePath $# \"$#\"" % + doCmd(getNimBin() & " $# -d:release --noBabelPath $# \"$#\"" % [pkgInfo.backend, args, realDir / bin.changeFileExt("nim")]) proc saveNimbleMeta(pkgDestDir, url: string, filesInstalled: TSet[string]) = @@ -797,8 +799,6 @@ proc doAction(options: TOptions) = assert false when isMainModule: - # TODO: Check for .babel dir and rename everything to nimble. - when defined(release): try: parseCmdLine().doAction() diff --git a/src/nimblepkg/config.nim b/src/nimblepkg/config.nim index b24825a..6f5e99b 100644 --- a/src/nimblepkg/config.nim +++ b/src/nimblepkg/config.nim @@ -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()