restorecc.nim 404 B

1234567891011121314151617
  1. import os, strutils
  2. proc main(dir: string, wanted: string) =
  3. for kind, path in walkDir(dir):
  4. case kind
  5. of pcFile:
  6. let name = extractFilename(path)
  7. if name == wanted:
  8. let newLoc = path.replace("mingw_backup", "mingw")
  9. echo "creating ", newLoc
  10. copyFile(path, newLoc)
  11. of pcDir: main(path, wanted)
  12. else: discard
  13. main("dist/mingw_backup", paramStr(1))