Skip to content

Commit 728fc76

Browse files
committed
Using regex matching for ignore file for more flexibility
1 parent d3c3a08 commit 728fc76

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lambda_uploader/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
import shutil
1717
import logging
18+
import re
1819

1920

2021
LOG = logging.getLogger(__name__)
@@ -45,6 +46,6 @@ def _ignore_file(path, ignore=[]):
4546
if not ignore:
4647
return False
4748
for ign in ignore:
48-
if ign in path:
49+
if re.search(ign, path):
4950
return True
5051
return False

test/test_utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
'bar/foo.py',
1212
'bar/bar/foo.py',
1313
'ignore/foo.py'
14+
'ignore-me.py'
1415
]
1516

16-
TEST_IGNORE = ['ignore/']
17+
TEST_IGNORE = ['ignore/*', 'ignore-me.py']
1718

1819

1920
def test_copy_tree():

0 commit comments

Comments
 (0)