Merge pull request #5 from fowlmouth/patch-2

try to update the install repo before cloning
This commit is contained in:
Dominik Picheta 2013-05-03 15:06:36 -07:00
commit d6be7b84e6

View file

@ -199,10 +199,15 @@ proc install(packages: seq[String]) =
case pkg.downloadMethod
of "git":
echo("Executing git...")
removeDir(downloadDir)
doCmd("git clone --depth 1 " & pkg.url & " " & downloadDir)
if existsDir(downloadDir / ".git"):
doCmd("cd "& downloadDir &" && git pull")
else:
removeDir(downloadDir)
doCmd("git clone --depth 1 " & pkg.url & " " & downloadDir)
if dvcsTag != "":
doCmd("cd \"" & downloadDir & "\" && git checkout " & dvcsTag)
else: quit("Unknown download method: " & pkg.downloadMethod, QuitFailure)
installFromDir(downloadDir, dvcsTag == "")