fis-command-release
Advanced tools
Comparing version 0.12.0 to 0.12.1
{ | ||
"name": "fis-command-release", | ||
"description": "fis release command.", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"author": "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage": "http://fis.baidu.com/", |
@@ -17,21 +17,30 @@ /* | ||
var ignoredReg = /[\/\\](?:output\b[^\/\\]*([\/\\]|$)|\.|fis-conf\.js$)/i; | ||
opt.srcCache = fis.project.getSource(); | ||
// init cache | ||
var files = fis.project.getSource(); | ||
fis.util.map(files, function (subpath, file) { | ||
opt.srcCache = opt.srcCache || []; | ||
opt.srcCache.push(file.realpath); | ||
}); | ||
// first compile | ||
release(opt); | ||
function listener(type){ | ||
return function (path) { | ||
var p; | ||
if(safePathReg.test(path)){ | ||
var file = fis.file.wrap(path); | ||
var path = fis.util(path); | ||
if (type == 'add' || type == 'change') { | ||
if (!opt.srcCache[file.subpath] && file.release) { | ||
opt.srcCache[file.subpath] = file; | ||
if (opt.srcCache.indexOf(path) == -1) { | ||
opt.srcCache.push(path); | ||
} | ||
} else if (type == 'unlink') { | ||
if (opt.srcCache[file.subpath]) { | ||
delete opt.srcCache[file.subpath]; | ||
if ((p = opt.srcCache.indexOf(path)) > -1) { | ||
opt.srcCache.splice(p, 1); | ||
} | ||
} else if (type == 'unlinkDir') { | ||
fis.util.map(opt.srcCache, function (subpath, file) { | ||
if (file.realpath.indexOf(path) !== -1) { | ||
delete opt.srcCache[subpath]; | ||
opt.srcCache.forEach(function (realpath) { | ||
if ((p = realpath.indexOf(path)) > -1) { | ||
opt.srcCache.splice(p, 1); | ||
} | ||
@@ -41,3 +50,3 @@ }); | ||
clearTimeout(timer); | ||
timer = setTimeout(function(){ | ||
timer = setTimeout(function() { | ||
release(opt); | ||
@@ -44,0 +53,0 @@ }, 500); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59404
1563