-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
31 lines (25 loc) · 909 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var path = require("path"),
minimatch = require("minimatch"),
traceur = require("traceur");
var lib = new RegExp("^(" + (path.dirname(module.filename) + path.sep).replace(/\\/g, "\\\\") + ")", "i");
traceur.require.makeDefault(function(filename) {
if(lib.test(filename)) {
return minimatch(filename.replace(lib, ""), "lib/**/*.js");
}
});
module.exports = require("./lib/tasks");
var cwd = new RegExp("^(" + (process.cwd() + path.sep).replace(/\\/g, "\\\\") + ")", "i");
var task_patterns = [];
module.exports.config = config;
function config(options) {
if(options && options.tasks) {
task_patterns = task_patterns.concat(options.tasks);
}
}
traceur.require.makeDefault(function(filename) {
if(cwd.test(filename)) {
return task_patterns.some(function(glob) {
return minimatch(filename.replace(cwd, ""), glob);
});
}
});