Skip to content

Instantly share code, notes, and snippets.

@nigelbabu
Created June 13, 2017 09:17
Show Gist options
  • Save nigelbabu/5d69e17d88b881b24b3b6078eef56c00 to your computer and use it in GitHub Desktop.
Save nigelbabu/5d69e17d88b881b24b3b6078eef56c00 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from fnmatch import fnmatch
import sys
matched = False
with open('.testignore') as ignore:
for pattern in ignore:
if fnmatch(sys.argv[2], pattern.strip()):
matched = True
break
if matched:
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment