Skip to content

Commit

Permalink
Revert "Separate out deprecated import file extensions"
Browse files Browse the repository at this point in the history
This reverts commit b9662fc.
  • Loading branch information
xzyfer committed Jul 2, 2018
1 parent 9a211eb commit 19fd2bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
14 changes: 1 addition & 13 deletions src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ namespace Sass {
// (2) underscore + given
// (3) underscore + given + extension
// (4) given + extension
std::vector<Include> resolve_includes(const std::string& root, const std::string& file, const std::vector<std::string>& exts, const std::vector<std::string>& d_exts)
std::vector<Include> resolve_includes(const std::string& root, const std::string& file, const std::vector<std::string>& exts)
{
std::string filename = join_paths(root, file);
// split the filename
Expand All @@ -350,18 +350,6 @@ namespace Sass {
abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
}
// next test d_exts plus underscore
for(auto ext : d_exts) {
rel_path = join_paths(base, "_" + name + ext);
abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
}
// next test plain name with d_exts
for(auto ext : d_exts) {
rel_path = join_paths(base, name + ext);
abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
}
// nothing found
return includes;
}
Expand Down
6 changes: 2 additions & 4 deletions src/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,10 @@ namespace Sass {

namespace File {

static std::vector<std::string> defaultExtensions = { ".scss", ".sass" };
static std::vector<std::string> deprecatedExtensions = { ".css" };
static std::vector<std::string> defaultExtensions = { ".scss", ".sass", ".css" };

std::vector<Include> resolve_includes(const std::string& root, const std::string& file,
const std::vector<std::string>& exts = defaultExtensions,
const std::vector<std::string>& d_exts = deprecatedExtensions);
const std::vector<std::string>& exts = defaultExtensions);

}

Expand Down

0 comments on commit 19fd2bf

Please sign in to comment.