claranet / jinjaform

Terraform wrapper with Jinja2 templates
MIT License
35 stars 8 forks source link

Delete broken symlinks in shared modules directory #23

Open raymondbutcher opened 5 years ago

raymondbutcher commented 5 years ago

I renamed a directory and it broke a bunch of symlinks in my .jinjaform/modules directory. I had to run terraform get -update to fix them. It would be handy if Jinjaform would notice the broken symlinks in that directory and delete them.

raymondbutcher commented 5 years ago

This is tricky.

If .jinaformrc has RUN ln -fs "${JINJAFORM_PROJECT_ROOT}/modules" "${JINJAFORM_WORKSPACE}/modules" then modules will be going through a symlink that only exists after the workspace has been created. So we can add this feature in the workspace creation function.

Perhaps this should be done with another command in .jinjaformrc, after the symlink is created but before the TERRAFORM_RUN command.