1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 14:48:49 +00:00

Run terraform init to initialize terraform modules

This commit is contained in:
Mathieu Cantin 2019-06-13 11:46:04 -04:00
parent 59dc6cbf90
commit 9589dabdd4
2 changed files with 14 additions and 0 deletions

View File

@ -286,6 +286,7 @@ following rules are enabled by default:
* `sudo_command_from_user_path` – runs commands from users `$PATH` with `sudo`;
* `switch_lang` – switches command from your local layout to en;
* `systemctl` – correctly orders parameters of confusing `systemctl`;
* `terraform_init.py` – run `terraform init` before plan or apply;
* `test.py` – runs `py.test` instead of `test.py`;
* `touch` – creates missing directories before "touching";
* `tsuru_login` – runs `tsuru login` if not authenticated or session expired;

View File

@ -0,0 +1,13 @@
from thefuck.shells import shell
from thefuck.utils import for_app
@for_app('terraform')
def match(command):
return ('this module is not yet installed' in command.output.lower() or
'initialization required' in command.output.lower()
)
def get_new_command(command):
return shell.and_('terraform init', command.script)