mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
Nimscript: added support for 'patchFile'
This commit is contained in:
@@ -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".
|
||||
|
||||
Reference in New Issue
Block a user