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
14
babel.nim
14
babel.nim
|
|
@ -199,10 +199,16 @@ proc install(packages: seq[String]) =
|
|||
case pkg.downloadMethod
|
||||
of "git":
|
||||
echo("Executing git...")
|
||||
removeDir(downloadDir)
|
||||
doCmd("git clone --depth 1 " & pkg.url & " " & downloadDir)
|
||||
if dvcsTag != "":
|
||||
doCmd("cd \"" & downloadDir & "\" && git checkout " & dvcsTag)
|
||||
if existsDir(downloadDir / ".git"):
|
||||
doCmd("cd "& downloadDir &" && git pull")
|
||||
if dvcsTag != "":
|
||||
doCmd("git checkout "& dvcsTag)
|
||||
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