Merge pull request #5 from fowlmouth/patch-2
try to update the install repo before cloning
This commit is contained in:
commit
d6be7b84e6
1 changed files with 7 additions and 2 deletions
|
|
@ -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 == "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue