Added rules to run terraform init before terraform plan or apply (#924)

* Run terraform init to initialize terraform modules

* Fix indent

* Add unit tests for terraform_init.py
This commit is contained in:
Mathieu Cantin
2019-06-26 14:02:01 -04:00
committed by Vladimir Iakovlev
parent e047c1eb40
commit 4c3a559124
3 changed files with 47 additions and 0 deletions
+13
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)