Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/command/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var ngraph = require('neuron-graph');
var neuron = require('neuronjs');
var util = require('util');
var MD5 = require('MD5');
var minimatch = require('minimatch');

// @param {Object} options
// see ./lib/option/build.js for details
Expand All @@ -38,14 +39,14 @@ build.run = function(options, callback) {
'server_link'
] : [
'read_cortex_json',
'clean_cortex_json',
'read_cortex_config_js',
'prepare_build_type',
'run_preinstall_script',
'run_prebuild_script',
// #478
// `cortex.main` and many other files might have not been generated before `cortex.scripts`
// so, we clean cortex_json
'clean_cortex_json',
'build_process',
'server_link',
'run_postbuild_script',
Expand All @@ -72,9 +73,12 @@ build.prepare_build_type = function(options, callback){
var file = options.file;

function hasFile(list){
return list.map(function(rel){
return node_path.join(options.cwd, rel);
}).indexOf(file) > -1;
if (!file) { return false; }

var rel = node_path.relative(options.cwd, file);
return (list || []).some(function(value) {
return minimatch(rel, value);
});
}

function isMod() {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"ignore": "^2.2.14",
"loggie": "^0.1.8",
"make-array": "^0.1.1",
"minimatch": "^3.0.0",
"mix2": "^1.0.0",
"cortex-neuron-builder": "^4.1.0",
"neuron-graph": "^1.0.0",
Expand Down