module SvelteOnRails::Installer::Utils

def self.app_root_path(app_root = nil)

def self.app_root_path(app_root = nil)
  if app_root
    raise "ERROR: app_root must be class Pathname" unless app_root.is_a?(Pathname)
    app_root
  else
    begin
      Dir.exist?(Rails.root.join('app'))
      Rails.root
    rescue => e
      raise "ERROR: Could not find Rails.root => #{e}"
    end
  end
end