diff --git a/griptape/cli/core/app_packager.py b/griptape/cli/core/app_packager.py index 12b0437..145f3a8 100644 --- a/griptape/cli/core/app_packager.py +++ b/griptape/cli/core/app_packager.py @@ -35,11 +35,17 @@ def get_deployment_source(self) -> str: def _create_deployment_tmp_dir(self) -> str: # Copy to new dir to ignore certain patterns - # TODO: Should more patterns be ignored? + ignore_patterns = [] + if os.path.exists(os.path.join(self.app_directory, ".gitignore")): + with open(os.path.join(self.app_directory, ".gitignore"), "r") as file: + for line in file.readlines(): + if line.endswith("\n"): + line = line[:-1] + ignore_patterns.append(line.strip()) return shutil.copytree( self.app_directory, os.path.join(self.app_directory, "zip_tmp"), - ignore=shutil.ignore_patterns(".venv*", "__pycache__*", "*.pyc"), + ignore=shutil.ignore_patterns(*ignore_patterns), ) def _create_deployment_zip_file(self, tmp_dir: str) -> str: diff --git a/griptape/cli/core/templates/app/{{cookiecutter.app_name}}/.gitignore b/griptape/cli/core/templates/app/{{cookiecutter.app_name}}/.gitignore new file mode 100644 index 0000000..d68b287 --- /dev/null +++ b/griptape/cli/core/templates/app/{{cookiecutter.app_name}}/.gitignore @@ -0,0 +1,4 @@ +venv* +.venv* +__pycache__* +*.pyc \ No newline at end of file