forked from AdguardTeam/Scriptlets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundler.js
45 lines (39 loc) · 1.17 KB
/
bundler.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { program } from 'commander';
import { buildScriptletsFunc } from './scripts/build-funcs';
import {
buildClick2Load,
buildRedirectsFiles,
buildRedirectsForCorelibs,
buildRedirectsList,
prebuildRedirects,
} from './scripts/build-redirects';
import { buildScriptletsForCorelibs } from './scripts/build-corelibs';
import { buildScriptlets, buildScriptletsList } from './scripts/build-scriptlets';
import { buildTxt } from './scripts/build-txt';
import { buildRedirectsMap } from './scripts/build-redirects-map';
const buildScriptletsAndRedirectsLists = async () => {
await Promise.all([buildRedirectsList(), buildScriptletsList()]);
};
const tasks = [
buildScriptletsAndRedirectsLists,
buildScriptletsFunc,
buildClick2Load,
buildRedirectsMap,
prebuildRedirects,
buildRedirectsFiles,
buildRedirectsForCorelibs,
buildScriptlets,
buildScriptletsForCorelibs,
buildTxt,
];
const runTasks = async (tasks, options) => {
for (const task of tasks) {
await task(options);
}
};
program
.description('Builds scriptlets')
.action(async () => {
await runTasks(tasks);
});
program.parse(process.argv);