Skip to content

Commit

Permalink
Fix for 0.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
genotrance committed Apr 25, 2019
1 parent 915d6b2 commit ae3ef9f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nimblepkg/nimscriptapi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var
project = ""
success = false
retVal = true
projectFile = ""

proc requires*(deps: varargs[string]) =
## Call this to set the list of requirements of your Nimble
Expand All @@ -44,7 +45,9 @@ proc getParams() =
for i in 2 .. paramCount():
let
param = paramStr(i)
if param[0] != '-' and param != projectPath():
if param.fileExists():
projectFile = param
elif param[0] != '-':
commandLineParams.add paramStr(i).normalize

proc getCommand*(): string =
Expand Down Expand Up @@ -131,7 +134,7 @@ proc onExit*() =
output &= "\"retVal\": " & $retVal
writeFile(projectPath() & ".out", "{" & output & "}")
writeFile(projectFile & ".out", "{" & output & "}")
# TODO: New release of Nim will move this `task` template under a
# `when not defined(nimble)`. This will allow us to override it in the future.
Expand Down Expand Up @@ -178,6 +181,6 @@ template after*(action: untyped, body: untyped): untyped =
proc getPkgDir*(): string =
## Returns the package directory containing the .nimble file currently
## being evaluated.
result = projectPath().rsplit(seps={'/', '\\', ':'}, maxsplit=1)[0]
result = projectFile.rsplit(seps={'/', '\\', ':'}, maxsplit=1)[0]
getParams()

0 comments on commit ae3ef9f

Please sign in to comment.