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:
parent
df11a6f6cf
commit
62699afaa8
1 changed files with 20 additions and 0 deletions
|
|
@ -10,6 +10,13 @@ type
|
||||||
DownloadMethod* {.pure.} = enum
|
DownloadMethod* {.pure.} = enum
|
||||||
git = "git", hg = "hg"
|
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) =
|
proc doCheckout(meth: DownloadMethod, downloadDir, branch: string) =
|
||||||
case meth
|
case meth
|
||||||
of DownloadMethod.git:
|
of DownloadMethod.git:
|
||||||
|
|
@ -23,6 +30,19 @@ proc doCheckout(meth: DownloadMethod, downloadDir, branch: string) =
|
||||||
cd downloadDir:
|
cd downloadDir:
|
||||||
doCmd("hg checkout " & branch)
|
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 = "",
|
proc doClone(meth: DownloadMethod, url, downloadDir: string, branch = "",
|
||||||
onlyTip = true) =
|
onlyTip = true) =
|
||||||
case meth
|
case meth
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue