Nimscript: added support for 'patchFile'

This commit is contained in:
Andreas Rumpf
2016-07-09 14:26:00 +02:00
parent 66f37971e9
commit 5e82ffc8d5
7 changed files with 52 additions and 3 deletions

View File

@@ -65,6 +65,21 @@ proc hint*(name: string; val: bool) =
let v = if val: "on" else: "off"
hintImpl(name & "]:" & v, "hint[" & name & "]:" & v)
proc patchFile*(package, filename, replacement: string) =
## Overrides the location of a given file belonging to the
## passed package.
## If the ``replacement`` is not an absolute path, the path
## is interpreted to be local to the Nimscript file that contains
## the call to ``patchFile``, Nim's ``--path`` is not used at all
## to resolve the filename!
##
## Example:
##
## .. code-block:: nim
##
## patchFile("stdlib", "asyncdispatch", "patches/replacement")
discard
proc getCommand*(): string =
## Gets the Nim command that the compiler has been invoked with, for example
## "c", "js", "build", "help".