try to update the install repo before cloning
This commit is contained in:
parent
4e3a1a1635
commit
0099dc9a01
1 changed files with 10 additions and 4 deletions
|
|
@ -199,10 +199,16 @@ 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")
|
||||||
|
if dvcsTag != "":
|
||||||
|
doCmd("git checkout "& dvcsTag)
|
||||||
|
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