Skip to content

Commit

Permalink
fix(templates): Avoid failing if VSCode IDE config is not requested f…
Browse files Browse the repository at this point in the history
…or target and mapper cookiecutter templates (meltano#2342)

Don't error trying to remove template `.vscode` directory, if it doesn't exist
  • Loading branch information
ReubenFrankel authored Mar 25, 2024
1 parent 1d7afa6 commit 61a5727
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cookiecutter/mapper-template/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
shutil.rmtree(Path(".github"))

if "{{ cookiecutter.ide }}" != "VSCode":
shutil.rmtree(".vscode")
shutil.rmtree(".vscode", ignore_errors=True)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ repos:
rev: v4.5.0
hooks:
- id: check-json
exclude: |
(?x)^(
.*/launch.json
)$
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter/target-template/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
shutil.rmtree(Path(".github"))

if "{{ cookiecutter.ide }}" != "VSCode":
shutil.rmtree(".vscode")
shutil.rmtree(".vscode", ignore_errors=True)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ repos:
rev: v4.5.0
hooks:
- id: check-json
exclude: |
(?x)^(
.*/launch.json
)$
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
Expand Down

0 comments on commit 61a5727

Please sign in to comment.