From 62699afaa8b63888b6d719b4d877d79291bcafe9 Mon Sep 17 00:00:00 2001 From: Ivan Bobev Date: Tue, 27 Aug 2019 15:17:08 +0300 Subject: [PATCH] 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 --- src/nimblepkg/download.nim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index d2e0074..85bf54f 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -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