Skip to content

Commit

Permalink
fix(template): Ensure .vscode directory is included when requested …
Browse files Browse the repository at this point in the history
…in cookiecutters and do not fail if it does not exist
  • Loading branch information
edgarrmondragon committed Jan 25, 2024
1 parent 392b1c7 commit 2e7cff2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
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
exclude: |
(?x)^(
Expand Down
2 changes: 2 additions & 0 deletions cookiecutter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Include template VSCode directory
!*/*/.vscode/
2 changes: 1 addition & 1 deletion cookiecutter/tap-template/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
shutil.rmtree(".github")

if "{{ cookiecutter.ide }}" != "VSCode":
shutil.rmtree(".vscode")
shutil.rmtree(".vscode", ignore_errors=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "{{ cookiecutter.tap_id }}",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "{{ cookiecutter.library_name }}",
"justMyCode": false,
"args": [
"--config",
".secrets/config.json",
],
},
]
}

0 comments on commit 2e7cff2

Please sign in to comment.