forked from AdguardTeam/FiltersRegistry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (23 loc) · 940 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
/* globals require, __dirname, process */
let whitelist = [];
let blacklist = [];
let args = process.argv.slice(2);
args.forEach(function (val) {
if (val.startsWith('-i=')) {
whitelist = whitelist.concat(val.substr(3).split(',').map(x => Number.parseInt(x)));
}
if (val.startsWith('-s=')) {
blacklist = blacklist.concat(val.substr(3).split(',').map(x => Number.parseInt(x)));
}
});
const path = require('path');
const compiler = require("adguard-filters-compiler");
const filtersDir = path.join(__dirname, './filters');
const logPath = path.join(__dirname, './log.txt');
let reportPath = path.join(__dirname, './report.txt');
if (whitelist.length > 0 || blacklist.length > 0) {
// Disable report if this is not a full build
reportPath = null;
}
const platformsPath = path.join(__dirname, './platforms');
compiler.compile(filtersDir, logPath, reportPath, platformsPath, whitelist, blacklist);