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
|
case pkg.downloadMethod
|
||||||
of "git":
|
of "git":
|
||||||
echo("Executing git...")
|
echo("Executing git...")
|
||||||
|
if existsDir(downloadDir / ".git"):
|
||||||
|
doCmd("cd "& downloadDir &" && git pull")
|
||||||
|
else:
|
||||||
removeDir(downloadDir)
|
removeDir(downloadDir)
|
||||||
doCmd("git clone --depth 1 " & pkg.url & " " & downloadDir)
|
doCmd("git clone --depth 1 " & pkg.url & " " & downloadDir)
|
||||||
|
|
||||||
if dvcsTag != "":
|
if dvcsTag != "":
|
||||||
doCmd("cd \"" & downloadDir & "\" && git checkout " & dvcsTag)
|
doCmd("cd \"" & downloadDir & "\" && git checkout " & dvcsTag)
|
||||||
|
|
||||||
else: quit("Unknown download method: " & pkg.downloadMethod, QuitFailure)
|
else: quit("Unknown download method: " & pkg.downloadMethod, QuitFailure)
|
||||||
|
|
||||||
installFromDir(downloadDir, dvcsTag == "")
|
installFromDir(downloadDir, dvcsTag == "")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue