summary refs log tree commit diff stats
path: root/tools/restorecc.nim
blob: f5d8f0bb376da9a5b507a0d6d0d37c3da11814e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os, strutils

proc main(dir: string, wanted: string) =
  for kind, path in walkDir(dir):
    case kind
    of pcFile:
      let name = extractFilename(path)
      if name == wanted:
        let newLoc = path.replace("mingw_backup", "mingw")
        echo "creating ", newLoc
        copyFile(path, newLoc)
    of pcDir: main(path, wanted)
    else: discard

main("dist/mingw_backup", paramStr(1))