Fixes nim-git AUR PKGBUILD.
./koch pdf now adds `bin/nim` to the PATH before executing the PDF build process.
This commit is contained in:
parent
92af223ab1
commit
6a78f17dae
1 changed files with 10 additions and 2 deletions
12
koch.nim
12
koch.nim
|
|
@ -79,9 +79,17 @@ proc findNim(): string =
|
|||
# assume there is a symlink to the exe or something:
|
||||
return nim
|
||||
|
||||
proc exec(cmd: string, errorcode: int = QuitFailure) =
|
||||
proc exec(cmd: string, errorcode: int = QuitFailure, additionalPATH = "") =
|
||||
let prevPATH = getEnv("PATH")
|
||||
if additionalPATH.len > 0:
|
||||
var absolute = additionalPATH
|
||||
if not absolute.isAbsolute:
|
||||
absolute = getCurrentDir() / absolute
|
||||
echo("Adding to $PATH: ", absolute)
|
||||
putEnv("PATH", prevPATH & PathSep & absolute)
|
||||
echo(cmd)
|
||||
if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
|
||||
putEnv("PATH", prevPATH)
|
||||
|
||||
proc tryExec(cmd: string): bool =
|
||||
echo(cmd)
|
||||
|
|
@ -146,7 +154,7 @@ proc website(args: string) =
|
|||
|
||||
proc pdf(args="") =
|
||||
exec("$# cc -r tools/nimweb.nim $# --pdf web/website.ini --putenv:nimversion=$#" %
|
||||
[findNim(), args, VersionAsString])
|
||||
[findNim(), args, VersionAsString], additionalPATH=findNim().splitFile.dir)
|
||||
|
||||
# -------------- boot ---------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue