This commit is contained in:
Dominik Picheta 2017-01-29 20:47:47 +01:00
commit c4d294ca9b

View file

@ -1,14 +1,14 @@
# Copyright (C) Dominik Picheta. All rights reserved. # Copyright (C) Dominik Picheta. All rights reserved.
# BSD License. Look at license.txt for more info. # BSD License. Look at license.txt for more info.
import parsecfg, json, streams, strutils, parseutils, os, tables import parsecfg, json, streams, strutils, parseutils, os, tables, future
from sequtils import apply, map
import version, tools, common, nimscriptsupport, options, packageinfo, cli import version, tools, common, nimscriptsupport, options, packageinfo, cli
## Contains procedures for parsing .nimble files. Moved here from ``packageinfo`` ## Contains procedures for parsing .nimble files. Moved here from ``packageinfo``
## because it depends on ``nimscriptsupport`` (``nimscriptsupport`` also ## because it depends on ``nimscriptsupport`` (``nimscriptsupport`` also
## depends on other procedures in ``packageinfo``. ## depends on other procedures in ``packageinfo``.
from sequtils import apply
type type
NimbleFile* = string NimbleFile* = string
@ -96,8 +96,12 @@ proc validatePackageStructure(pkgInfo: PackageInfo, options: Options) =
raiseNewValidationError(msg, true, hint, true) raiseNewValidationError(msg, true, hint, true)
else: else:
assert(not pkgInfo.isMinimal) assert(not pkgInfo.isMinimal)
# On Windows `pkgInfo.bin` has a .exe extension, so we need to normalize.
let normalizedBinNames = pkgInfo.bin.map(
(x) => x.changeFileExt("").toLowerAscii()
)
let correctDir = let correctDir =
if pkgInfo.name in pkgInfo.bin: if pkgInfo.name.toLowerAscii() in normalizedBinNames:
pkgInfo.name & "pkg" pkgInfo.name & "pkg"
else: else:
pkgInfo.name pkgInfo.name