haml / haml-rails

let your Gemfile do the talking
MIT License
1.04k stars 169 forks source link

Fixes to work inside Rails Application Templates (Thor Actions) #152

Closed ksouthworth closed 3 years ago

ksouthworth commented 5 years ago

I was trying to use the haml:erb2haml task inside a Rails Application Template and the task was not recognizing or honoring my ENV vars set on the CLI.

This PR changes the ENV checks a little bit to make it compatible with executing inside a Rails App Template.

I also added a new ENV var for HAML_RAILS_OVERWRITE_HAML to control the other user prompt of asking wether to overwrite existing haml files.

I'm using it like this from inside a rails app template

HAML_RAILS_DELETE_ERB=true HAML_RAILS_OVERWRITE_HAML=false rails haml:erb2haml
HamptonMakes commented 3 years ago

This looks good to me– thanks for the contribution!