mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
koch.nim: don't use --git-dir; produces weird results
This commit is contained in:
18
koch.nim
18
koch.nim
@@ -76,7 +76,7 @@ proc exe(f: string): string =
|
||||
result = result.replace('/','\\')
|
||||
|
||||
template withDir(dir, body) =
|
||||
let old = getCurrentDir(dir)
|
||||
let old = getCurrentDir()
|
||||
try:
|
||||
setCurrentDir(dir)
|
||||
body
|
||||
@@ -172,8 +172,9 @@ proc bundleNimbleSrc() =
|
||||
## always bundle the latest official release.
|
||||
if not dirExists("dist/nimble/.git"):
|
||||
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
|
||||
exec("git --git-dir dist/nimble/.git checkout -f stable")
|
||||
exec("git --git-dir dist/nimble/.git pull")
|
||||
withDir("dist/nimble"):
|
||||
exec("git checkout -f stable")
|
||||
exec("git pull")
|
||||
|
||||
proc bundleNimbleExe() =
|
||||
bundleNimbleSrc()
|
||||
@@ -192,11 +193,12 @@ proc buildNimble(latest: bool) =
|
||||
inc id
|
||||
installDir = "dist/nimble" & $id
|
||||
exec("git clone https://github.com/nim-lang/nimble.git " & installDir)
|
||||
if latest:
|
||||
exec("git --git-dir " & installDir & "/.git checkout -f master")
|
||||
else:
|
||||
exec("git --git-dir " & installDir & ".git checkout -f stable")
|
||||
exec("git --git-dir " & installDir & "/.git pull")
|
||||
withDir(installDir):
|
||||
if latest:
|
||||
exec("git checkout -f master")
|
||||
else:
|
||||
exec("git checkout -f stable")
|
||||
exec("git pull")
|
||||
nimexec("c --noNimblePath -p:compiler " & installDir / "src/nimble.nim")
|
||||
copyExe(installDir / "src/nimble".exe, "bin/nimble".exe)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user