Skip to content

Commit

Permalink
feat: use postCreateCommand to install hooks
Browse files Browse the repository at this point in the history
Setting system gitconfig is a workaround in devcontainers/cli#98
  • Loading branch information
0x4448 committed Jul 21, 2023
1 parent de5fb35 commit 4949437
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"build": {
"dockerfile": "Dockerfile"
},
"postAttachCommand": "pre-commit install --install-hooks",
"postCreateCommand": {
"set-safe-directory": "sudo git config --system --add safe.directory ${containerWorkspaceFolder}",
"install-pre-commit-hooks": "pre-commit install --install-hooks"
},
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -15,4 +18,4 @@
]
}
}
}
}

0 comments on commit 4949437

Please sign in to comment.