Skip to content

Commit 6d2cb9d

Browse files
committed
add ^ for beeing able to match a file from start without the / in blacklist.txt
1 parent b2e4df2 commit 6d2cb9d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/build.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828

2929
BLACKLIST_PATTERNS = [
3030
# code versionning
31-
'.hg',
32-
'.git',
33-
'.bzr',
34-
'.svn',
31+
'^*.hg/*',
32+
'^*.git/*',
33+
'^*.bzr/*',
34+
'^*.svn/*',
3535

3636
# temp files
3737
'~',
@@ -66,7 +66,11 @@ def compile_dir(dfn):
6666

6767
def is_blacklist(name):
6868
for pattern in BLACKLIST_PATTERNS:
69-
if fnmatch(name, '*/' + pattern):
69+
if pattern.startswith('^'):
70+
pattern = pattern[1:]
71+
else:
72+
pattern = '*/' + pattern
73+
if fnmatch(name, pattern):
7074
return True
7175

7276
def make_tar(fn, source_dirs, ignore_path=[]):

0 commit comments

Comments
 (0)