module Sass::Files

def find_file_to_import(filename, load_paths)

Raises:
  • (Sass::SyntaxError) - if `filename` ends in ``".sass"``

Returns:
  • (String) - The filename of the imported file.

Parameters:
  • load_paths (Array) -- The set of filesystem paths
  • filename (String) -- The filename to search for
def find_file_to_import(filename, load_paths)
  was_sass = false
  original_filename = filename
  if filename[-5..-1] == ".sass"
    filename = filename[0...-5]
    was_sass = true
  elsif filename[-4..-1] == ".css"
    return filename
  end
  new_filename = find_full_path("#{filename}.sass", load_paths)
  return new_filename if new_filename
  return filename + '.css' unless was_sass
  raise SyntaxError.new("File to import not found or unreadable: #{original_filename}.", @line)
end