fe1ac6d7e9
subrepo: subdir: "dotfiles/.vim/plugged/syntastic" merged: "8d5e37c29" upstream: origin: "https://github.com/vim-syntastic/syntastic.git" branch: "master" commit: "8d5e37c29" git-subrepo: version: "0.4.3" origin: "???" commit: "???"
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
// Generated by CoffeeScript 1.3.3
|
|
(function() {
|
|
var args, fs, less, options, parser;
|
|
|
|
fs = require('fs');
|
|
|
|
less = require('less');
|
|
|
|
args = process.argv.slice(1);
|
|
|
|
options = {};
|
|
|
|
args = args.filter(function(arg) {
|
|
var match;
|
|
match = arg.match(/^-I(.+)$/);
|
|
if (match) {
|
|
options.paths.push(match[1]);
|
|
return false;
|
|
}
|
|
match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i);
|
|
if (match) {
|
|
arg = match[1];
|
|
} else {
|
|
return arg;
|
|
}
|
|
switch (arg) {
|
|
case 'strict-imports':
|
|
return options.strictImports = true;
|
|
case 'include-path':
|
|
return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) {
|
|
if (p) {
|
|
return path.resolve(process.cwd(), p);
|
|
}
|
|
});
|
|
case 'O0':
|
|
return options.optimization = 0;
|
|
case 'O1':
|
|
return options.optimization = 1;
|
|
case 'O2':
|
|
return options.optimization = 2;
|
|
}
|
|
});
|
|
|
|
options.filename = args[1];
|
|
|
|
parser = new less.Parser(options);
|
|
|
|
fs.readFile(options.filename, 'utf-8', function(err, data) {
|
|
return parser.parse(data, function(err, tree) {
|
|
if (err) {
|
|
less.writeError(err);
|
|
return process.exit(1);
|
|
}
|
|
});
|
|
});
|
|
|
|
}).call(this);
|