Implemented download of packages residing in mercurial repos.
* Moved download handling code into a download module. * Documented how versioning works for repos (via tags). * More info during install about what tag is picked. * Refactored download code to be more generic.
This commit is contained in:
parent
d826584f21
commit
07b7f46fd6
6 changed files with 162 additions and 77 deletions
15
tools.nim
15
tools.nim
|
|
@ -5,6 +5,21 @@
|
|||
import osproc, pegs, strutils, os
|
||||
import version
|
||||
|
||||
# TODO: Merge with common.nim?
|
||||
|
||||
proc doCmd*(cmd: string) =
|
||||
let exitCode = execCmd(cmd)
|
||||
if exitCode != QuitSuccess:
|
||||
quit("Execution failed with exit code " & $exitCode, QuitFailure)
|
||||
|
||||
template cd*(dir: string, body: stmt) =
|
||||
## Sets the current dir to ``dir``, executes ``body`` and restores the
|
||||
## previous working dir.
|
||||
let lastDir = getCurrentDir()
|
||||
setCurrentDir(dir)
|
||||
body
|
||||
setCurrentDir(lastDir)
|
||||
|
||||
proc getNimrodVersion*: TVersion =
|
||||
let vOutput = execProcess("nimrod -v")
|
||||
var matches: array[0..MaxSubpatterns, string]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue