koch: 'update' feature optional for less dependencies
This commit is contained in:
parent
a42a5e8e7c
commit
202972dea0
1 changed files with 63 additions and 51 deletions
16
koch.nim
16
koch.nim
|
|
@ -11,7 +11,10 @@ when defined(gcc) and defined(windows):
|
||||||
{.link: "icons/koch.res".}
|
{.link: "icons/koch.res".}
|
||||||
|
|
||||||
import
|
import
|
||||||
os, strutils, parseopt, osproc, httpclient, streams
|
os, strutils, parseopt, osproc, streams
|
||||||
|
|
||||||
|
when defined(withUpdate):
|
||||||
|
import httpclient
|
||||||
when defined(haveZipLib):
|
when defined(haveZipLib):
|
||||||
import zipfiles
|
import zipfiles
|
||||||
|
|
||||||
|
|
@ -37,6 +40,7 @@ Possible Commands:
|
||||||
inno [options] builds the Inno Setup installer (for Windows)
|
inno [options] builds the Inno Setup installer (for Windows)
|
||||||
tests run the testsuite
|
tests run the testsuite
|
||||||
update updates nimrod to the latest version from github
|
update updates nimrod to the latest version from github
|
||||||
|
(compile koch with -d:withUpdate to enable)
|
||||||
Boot options:
|
Boot options:
|
||||||
-d:release produce a release version of the compiler
|
-d:release produce a release version of the compiler
|
||||||
-d:tinyc include the Tiny C backend (not supported on Windows)
|
-d:tinyc include the Tiny C backend (not supported on Windows)
|
||||||
|
|
@ -183,6 +187,10 @@ proc clean(args: string) =
|
||||||
|
|
||||||
# -------------- update -------------------------------------------------------
|
# -------------- update -------------------------------------------------------
|
||||||
|
|
||||||
|
when defined(withUpdate):
|
||||||
|
when defined(windows):
|
||||||
|
{.warning: "Windows users: Make sure to run 'koch update' in Bash.".}
|
||||||
|
|
||||||
proc update(args: string) =
|
proc update(args: string) =
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
echo("Windows users: Make sure to be running this in Bash. ",
|
echo("Windows users: Make sure to be running this in Bash. ",
|
||||||
|
|
@ -268,7 +276,11 @@ of cmdArgument:
|
||||||
of "inno": inno(op.cmdLineRest)
|
of "inno": inno(op.cmdLineRest)
|
||||||
of "install": install(op.cmdLineRest)
|
of "install": install(op.cmdLineRest)
|
||||||
of "test", "tests": tests(op.cmdLineRest)
|
of "test", "tests": tests(op.cmdLineRest)
|
||||||
of "update": update(op.cmdLineRest)
|
of "update":
|
||||||
|
when defined(withUpdate):
|
||||||
|
update(op.cmdLineRest)
|
||||||
|
else:
|
||||||
|
quit "this Koch has not been compiled with -d:withUpdate"
|
||||||
else: showHelp()
|
else: showHelp()
|
||||||
of cmdEnd: showHelp()
|
of cmdEnd: showHelp()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue