koch.nim: don't use --git-dir; produces weird results

This commit is contained in:
Araq 2017-01-03 22:15:59 +01:00
commit b3b2203aba

View file

@ -76,7 +76,7 @@ proc exe(f: string): string =
result = result.replace('/','\\') result = result.replace('/','\\')
template withDir(dir, body) = template withDir(dir, body) =
let old = getCurrentDir(dir) let old = getCurrentDir()
try: try:
setCurrentDir(dir) setCurrentDir(dir)
body body
@ -172,8 +172,9 @@ proc bundleNimbleSrc() =
## always bundle the latest official release. ## always bundle the latest official release.
if not dirExists("dist/nimble/.git"): if not dirExists("dist/nimble/.git"):
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble") exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
exec("git --git-dir dist/nimble/.git checkout -f stable") withDir("dist/nimble"):
exec("git --git-dir dist/nimble/.git pull") exec("git checkout -f stable")
exec("git pull")
proc bundleNimbleExe() = proc bundleNimbleExe() =
bundleNimbleSrc() bundleNimbleSrc()
@ -192,11 +193,12 @@ proc buildNimble(latest: bool) =
inc id inc id
installDir = "dist/nimble" & $id installDir = "dist/nimble" & $id
exec("git clone https://github.com/nim-lang/nimble.git " & installDir) exec("git clone https://github.com/nim-lang/nimble.git " & installDir)
if latest: withDir(installDir):
exec("git --git-dir " & installDir & "/.git checkout -f master") if latest:
else: exec("git checkout -f master")
exec("git --git-dir " & installDir & ".git checkout -f stable") else:
exec("git --git-dir " & installDir & "/.git pull") exec("git checkout -f stable")
exec("git pull")
nimexec("c --noNimblePath -p:compiler " & installDir / "src/nimble.nim") nimexec("c --noNimblePath -p:compiler " & installDir / "src/nimble.nim")
copyExe(installDir / "src/nimble".exe, "bin/nimble".exe) copyExe(installDir / "src/nimble".exe, "bin/nimble".exe)