Revert deletion of two not used procedures

The two currently not used procedures `getSpecificDir` and `doPull` from
`download.nim` file are reverted according to dom96's suggestion in the
code review of pull request #692. Now they are marked with used pragma
to disable the warning.

Related to #680
This commit is contained in:
Ivan Bobev 2019-08-27 15:17:08 +03:00 committed by Dominik Picheta
commit 62699afaa8

View file

@ -10,6 +10,13 @@ type
DownloadMethod* {.pure.} = enum
git = "git", hg = "hg"
proc getSpecificDir(meth: DownloadMethod): string {.used.} =
case meth
of DownloadMethod.git:
".git"
of DownloadMethod.hg:
".hg"
proc doCheckout(meth: DownloadMethod, downloadDir, branch: string) =
case meth
of DownloadMethod.git:
@ -23,6 +30,19 @@ proc doCheckout(meth: DownloadMethod, downloadDir, branch: string) =
cd downloadDir:
doCmd("hg checkout " & branch)
proc doPull(meth: DownloadMethod, downloadDir: string) {.used.} =
case meth
of DownloadMethod.git:
doCheckout(meth, downloadDir, "")
cd downloadDir:
doCmd("git pull")
if existsFile(".gitmodules"):
doCmd("git submodule update")
of DownloadMethod.hg:
doCheckout(meth, downloadDir, "default")
cd downloadDir:
doCmd("hg pull")
proc doClone(meth: DownloadMethod, url, downloadDir: string, branch = "",
onlyTip = true) =
case meth