Fix @import file loading routine
Again, old fs.open syntax is deprecated, replaced with fs.readFile.
This commit is contained in:
parent
8e846a3b11
commit
ef71bb0db2
@ -99,13 +99,7 @@ less.Parser.importer = function (file, paths, callback) {
|
||||
}
|
||||
|
||||
if (pathname) {
|
||||
fs.stat(pathname, function (e, stats) {
|
||||
if (e) sys.error(e);
|
||||
|
||||
fs.open(pathname, process.O_RDONLY, stats.mode, function (e, fd) {
|
||||
if (e) sys.error(e);
|
||||
|
||||
fs.read(fd, stats.size, 0, "utf8", function (e, data) {
|
||||
fs.readFile(pathname, 'utf-8', function(e, data) {
|
||||
if (e) sys.error(e);
|
||||
|
||||
new(less.Parser)({
|
||||
@ -116,8 +110,6 @@ less.Parser.importer = function (file, paths, callback) {
|
||||
callback(root);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
sys.error("file '" + file + "' wasn't found.\n");
|
||||
process.exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user