The .nimble extension is now used for both ini and nims .nimble files.
This is done by parsing the .nimble file using the ini parser first, then if that fails evaluating it using nimscript.
This commit is contained in:
parent
0fcf0b2de9
commit
dbd478bc20
4 changed files with 61 additions and 20 deletions
|
|
@ -93,6 +93,16 @@ proc readPackageInfoFromNims*(scriptName: string; result: var PackageInfo) =
|
|||
## Executes the `scriptName` nimscript file. Reads the package information
|
||||
## that it populates.
|
||||
|
||||
# Setup custom error handling.
|
||||
msgs.gErrorMax = high(int)
|
||||
var previousMsg = ""
|
||||
msgs.writeLnHook =
|
||||
proc (output: string) =
|
||||
# The error counter is incremented after the writeLnHook is invoked.
|
||||
if msgs.gErrorCounter > 0:
|
||||
raise newException(NimbleError, previousMsg)
|
||||
previousMsg = output
|
||||
|
||||
# Execute the nimscript file.
|
||||
execScript(scriptName)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue