Skip to content

Commit

Permalink
fixing bug related to ignoring all json files (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandeivert committed Mar 20, 2020
1 parent 3ad16d0 commit 5c1e667
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion streamalert_cli/manage_lambda/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,17 @@ def create(self):
def _copy_files(self, temp_package_path):
"""Copy all files and folders into temporary package path."""
for path in self.package_files:
# Default to ignoring zipped dependencies
ignored_items = {'*dependencies.zip'}
if path == 'rules':
# Also ignore json test event files if this is the rules directory
ignored_items.add('*.json')

if os.path.isdir(path):
# Copy the directory, skipping any files with a 'dependencies.zip' suffix
shutil.copytree(
path, os.path.join(temp_package_path, path),
ignore=shutil.ignore_patterns('*dependencies.zip', '*.json')
ignore=shutil.ignore_patterns(*ignored_items)
)
else:
# Ensure the parent directory of the file being copied already exists
Expand Down

0 comments on commit 5c1e667

Please sign in to comment.