thehecksteam / hecks_on_rails

Tools for mixing in Hecks Domains with Ruby on Rails
MIT License
1 stars 0 forks source link

Spring is swallowing ARGSV #3

Open chrisyoung opened 4 years ago

chrisyoung commented 4 years ago

Maybe put the value into an environment variable to be read in the engine. If we had access we could determine what command is being run and not overwrite the templates unless its a hecks command.

require 'hecks-app'

module HecksOnRails
  class Engine < ::Rails::Engine
    config.app_generators do |g|
      if ENV[ARGSV_FROM_SPRING].first.include? 'hecks'
           g.templates << File.expand_path('../templates', __dir__)
      end
      g.orm false
    end
  end
end
chrisyoung commented 4 years ago

For now, hecks_on_rails is incompatible with Spring