fix js file detection in c9 publish

pull/39/head^2
nightwing 2015-03-07 00:11:52 +04:00
rodzic fe6f2c260d
commit 657fe113d2
1 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -342,9 +342,14 @@ define(function(require, exports, module) {
// Validate plugins
var plugins = {};
fs.readdirSync(cwd).map(function(filename) {
if (/_test\.js$/.test(filename) || !/.js/.test(filename)) return;
var val = fs.readFileSync(cwd + "/" + filename);
fs.readdirSync(cwd).forEach(function(filename) {
if (/_test\.js$/.test(filename) || !/\.js$/.test(filename)) return;
try {
var val = fs.readFileSync(cwd + "/" + filename);
} catch(e) {
if (e.code == "EISDIR") return;
throw e;
}
if (!/\(options,\s*imports,\s*register\)/.test(val)) return;
if (!/consumes\s*=/.test(val)) return;
if (!/provides\s*=/.test(val)) return;