module SvelteOnRails::Installer::Utils

def self.which_root_route(app_root = nil)

def self.which_root_route(app_root = nil)
  # Check if the root route is active (uncommented) or commented out
  routes = File.read(app_root_path(app_root).join('config', 'routes.rb'))
  m = routes.match(/^\s*root\s+['"]([^'"]+)['"]/m)
  if m
    m.to_s.match(/^\s*root\s*['"]([^'"]*)['"]/)[1]
  end
end