From c4d294ca9bfa8b69df48e6232c6768c197803716 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 29 Jan 2017 20:47:47 +0100 Subject: [PATCH] Fixes #319. --- src/nimblepkg/packageparser.nim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/nimblepkg/packageparser.nim b/src/nimblepkg/packageparser.nim index fef696b..f93714d 100644 --- a/src/nimblepkg/packageparser.nim +++ b/src/nimblepkg/packageparser.nim @@ -1,14 +1,14 @@ # Copyright (C) Dominik Picheta. All rights reserved. # 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 ## Contains procedures for parsing .nimble files. Moved here from ``packageinfo`` ## because it depends on ``nimscriptsupport`` (``nimscriptsupport`` also ## depends on other procedures in ``packageinfo``. -from sequtils import apply - type NimbleFile* = string @@ -96,8 +96,12 @@ proc validatePackageStructure(pkgInfo: PackageInfo, options: Options) = raiseNewValidationError(msg, true, hint, true) else: 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 = - if pkgInfo.name in pkgInfo.bin: + if pkgInfo.name.toLowerAscii() in normalizedBinNames: pkgInfo.name & "pkg" else: pkgInfo.name