Skip to content

Commit

Permalink
docs: Improve workaround
Browse files Browse the repository at this point in the history
Relates: #203
  • Loading branch information
MaxymVlasov committed Sep 29, 2021
1 parent f9160b3 commit b1358e2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,23 @@ Example:
- --envs=AWS_SECRET_ACCESS_KEY="asecretkey"
```
3. It may happen that Terraform working directory (`.terraform`) already exists but not in the best condition (eg, not initialized modules, wrong version of Terraform, etc). To solve this problem you can find and delete all `.terraform` directories in your repository using this command:
3. It may happen that Terraform working directory (`.terraform`) already exists but not in the best condition (eg, not initialized modules, wrong version of Terraform, etc). To solve this problem you can find and delete all `.terraform` directories in your repository:
```shell
find . -type d -name ".terraform" -print0 | xargs -0 rm -r
```bash
echo "
function rm_terraform {
find . -name ".terraform*" -print0 | xargs -0 rm -r
}
alias rmtf=rm_terraform
" >>~/.bashrc
# Reload shell and use `rmtf` command in repo root
```
`terraform_validate` hook will try to reinitialize them before running `terraform validate` command.
**Warning:** If you use Terraform workspaces, DO NOT use this workaround ([details](https://github.com/antonbabenko/pre-commit-terraform/issues/203#issuecomment-918791847)). Wait to [`force-init`](https://github.com/antonbabenko/pre-commit-terraform/issues/224) option implementation
## Notes for contributors
1. Python hooks are supported now too. All you have to do is:
Expand Down

0 comments on commit b1358e2

Please sign in to comment.