aws-greengrass-gdk-cli
aws-greengrass-gdk-cli copied to clipboard
(gdk): `component build` Hidden directories are included in component's zip artifact when using 'zip' build system
https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/a2b4a4b7b6867a39e12d52a2a3997b9a4a605ac2/gdk/commands/component/BuildCommand.py#L221
Describe the bug Hidden directories in the component's root directory should not be included in the component's zip artifact
To Reproduce
Run gdk component publish
with some hidden folder (.venv, .cache, .git) in the component's root directory
Expected behavior Component's zip artifact should not include hidden files and directories
Actual behavior Component's zip artifact includes hidden files and directories, causing excessive file size
Hey @jfduque,
Thanks for pointing this out, the team will look into this.
Hi, @Nelsonochoam
we encounter the "excessive file size" issue mentioned by @jfduque
A proposed solution is to modify
https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/a2b4a4b7b6867a39e12d52a2a3997b9a4a605ac2/gdk/commands/component/BuildCommand.py#L183
into
shutil.copytree(utils.current_directory, artifacts_zip_build, ignore=shutil.ignore_patterns(*self._ignore_files_during_zip(None, None)))
This is fixed in GDK 1.2.0.