From 88ab8cb09f01999a7b2989208d7fcb9006ed0566 Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:38:16 +0530 Subject: [PATCH] chore: added a null check for content v1 spec file (#610) # Fixes # Added a null check for content_v1 file before removing it. ### Checklist - [x] I acknowledge that all my contributions will be made under the project's license - [ ] Run `make test-docker` - [ ] Verify affected language: - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our [OpenAPI specification](https://github.com/twilio/twilio-oai) using the [build_twilio_go.py](./examples/build_twilio_go.py) using `python examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-go` and inspect the diff - [ ] Run `make test` in `twilio-go` - [ ] Create a pull request in `twilio-go` - [ ] Provide a link below to the pull request - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please create a GitHub Issue in this repository. --- scripts/build_twilio_library.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build_twilio_library.py b/scripts/build_twilio_library.py index c7d983c4d..25c93f366 100644 --- a/scripts/build_twilio_library.py +++ b/scripts/build_twilio_library.py @@ -32,7 +32,8 @@ def build(openapi_spec_path: str, output_path: str, language: str) -> None: else: spec_folder = openapi_spec_path spec_files = sorted(os.listdir(spec_folder)) - spec_files.remove('twilio_content_v1.json') + if 'twilio_content_v1.json' in spec_files: + spec_files.remove('twilio_content_v1.json') generate(spec_folder, spec_files, output_path, language)