Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, strutils, sequtils
- let currDir: string = getCurrentDir()
- proc listFiles(dir: string, ignored: seq) =
- for kind, path in walkDir(dir):
- if kind == pcFile and any(ignored, proc (i: string): bool = return contains(kind, i)):
- echo replace(path, currDir)
- else:
- listFiles(path, ignored)
- var f: File
- if open(f,".gitignore"):
- let ignored: seq = toSeq(lines(f))
- listFiles(currDir, ignored)
- else:
- listFiles(currDir, newSeqWith(0, 0))
Advertisement
Add Comment
Please, Sign In to add comment