1
0
Fork 0
mirror of https://github.com/haml/haml-rails.git synced 2022-11-09 12:34:15 -05:00

Check the result of external html2haml command and output a proper message

This commit is contained in:
Akira Matsuda 2022-10-07 11:43:56 +09:00
parent 8bbe246a9c
commit 175d472bea
No known key found for this signature in database

View file

@ -17,8 +17,12 @@ module Haml
if File.exist?(app_layout_from)
if !File.exist?(app_layout_to)
`html2haml #{app_layout_from.shellescape} #{app_layout_to.shellescape}`
puts "Success! app/views/layouts/application.html.haml is created.\n" \
"Please remove the erb file: app/views/layouts/application.html.erb"
if $?.success?
puts "Success! app/views/layouts/application.html.haml is created.\n" \
"Please remove the erb file: app/views/layouts/application.html.erb"
else
puts "Error! Failed to execute html2haml command."
end
else
puts "Error! There is a file named app/views/layouts/application.html.haml already."
end