From 0099dc9a01413e0d4cc5ecddfd4246b1e871a7db Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire Date: Thu, 2 May 2013 09:00:20 -0500 Subject: [PATCH 1/2] try to update the install repo before cloning --- babel.nim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/babel.nim b/babel.nim index 6d49432..8b48a4d 100644 --- a/babel.nim +++ b/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 == "") From fbe207231bd59f1b2209162d6d4c5aabec5e457a Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire Date: Thu, 2 May 2013 21:04:10 -0500 Subject: [PATCH 2/2] Update babel.nim --- babel.nim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/babel.nim b/babel.nim index 8b48a4d..6d66025 100644 --- a/babel.nim +++ b/babel.nim @@ -201,13 +201,12 @@ proc install(packages: seq[String]) = echo("Executing git...") 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) + + if dvcsTag != "": + doCmd("cd \"" & downloadDir & "\" && git checkout " & dvcsTag) else: quit("Unknown download method: " & pkg.downloadMethod, QuitFailure)