// filter builds via command line arg
if (process.argv[2]) {
//就是获取参数。process.argv[2] 就是获取参数是一个字符串,然后用split() 方法用于把一个字符串分割成字符串数组。
const filters = process.argv[2].split(",");
builds = builds.filter((b) => {
//filter会返回为true的值,some是为了只需满足一个条件就可以返回true
return filters.some(
(f) => b.output.file.indexOf(f) > -1 || b._name.indexOf(f) > -1
);
});
} else {
// filter out weex builds by default
builds = builds.filter((b) => {
return b.output.file.indexOf("weex") === -1;
});
}
build(builds);
http://nodejs.cn/api/process/process_argv.html