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
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.