Skip to content

Commit

Permalink
getPkgDir impl
Browse files Browse the repository at this point in the history
  • Loading branch information
genotrance committed Apr 16, 2019
1 parent 7d0a40a commit 51d03b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/nimblepkg/nimscriptapi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ template after*(action: untyped, body: untyped): untyped =
if astToStr(action) & "After" in params:
retVal = `action After`()
template builtin = discard
proc getPkgDir*(): string =
proc getPkgDir(): string =
## Returns the package directory containing the .nimble file currently
## being evaluated.
builtin
result = currentSourcePath.rsplit(seps={'/', '\\', ':'}, maxsplit=1)[0]
2 changes: 1 addition & 1 deletion src/nimblepkg/nimscriptwrapper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ proc setupNimscript*(scriptName: string, options: Options): tuple[nimsFile, iniF
if exitCode == 0 and output.len != 0:
result.iniFile.writeFile(output)
else:
raise newException(NimbleError, "printPkgInfo() failed")
raise newException(NimbleError, output & "\nprintPkgInfo() failed")

proc execScript*(scriptName, actionName: string, options: Options): ExecutionResult[bool] =
let
Expand Down

0 comments on commit 51d03b3

Please sign in to comment.