File tree Expand file tree Collapse file tree 3 files changed +54
-15
lines changed Expand file tree Collapse file tree 3 files changed +54
-15
lines changed Original file line number Diff line number Diff line change
1
+ const { execSync } = require ( "child_process" ) ;
2
+ const readline = require ( "readline" ) ;
3
+ const fs = require ( "fs" ) ;
4
+
5
+ const rl = readline . createInterface ( {
6
+ input : process . stdin ,
7
+ output : process . stdout ,
8
+ } ) ;
9
+
10
+ execSync (
11
+ "curl -o data/easylist.to/easylist/easylist.txt https://easylist.to/easylist/easylist.txt"
12
+ ) ;
13
+ execSync (
14
+ "curl -o data/easylist.to/easylist/easyprivacy.txt https://easylist.to/easylist/easyprivacy.txt"
15
+ ) ;
16
+ execSync (
17
+ "curl -o data/easylist.to/easylistgermany/easylistgermany.txt https://easylist.to/easylistgermany/easylistgermany.txt"
18
+ ) ;
19
+
20
+ ( async ( ) => {
21
+ console . log (
22
+ "You need to provide Brave Services Key and target version to update brave-main-list.txt"
23
+ ) ;
24
+ const apiKey = await new Promise ( ( resolve ) => {
25
+ rl . question ( "Enter Brave Services Key: " , resolve ) ;
26
+ } ) ;
27
+
28
+ const version = await new Promise ( ( resolve ) => {
29
+ rl . question ( "Enter target version (i.e 1.0.10268): " , resolve ) ;
30
+ } ) ;
31
+
32
+ const versionNumber = version . replace ( / \. / g, "_" ) ;
33
+ const extensionId = "iodkpdagapdfkphljnddpjlldadblomo" ;
34
+
35
+ execSync (
36
+ `curl -o extension.zip -H "BraveServiceKey: ${ apiKey } " ` +
37
+ `https://brave-core-ext.s3.brave.com/release/${ extensionId } /extension_${ versionNumber } .crx`
38
+ ) ;
39
+
40
+ try {
41
+ execSync ( "unzip extension.zip list.txt" ) ;
42
+ } catch ( e ) {
43
+ if ( ! fs . existsSync ( "list.txt" ) ) {
44
+ console . error ( "Failed to find list.txt in extension.zip" ) ;
45
+ process . exit ( 1 ) ;
46
+ }
47
+ }
48
+
49
+ execSync ( "mv -f list.txt data/brave/brave-main-list.txt" ) ;
50
+
51
+ fs . unlinkSync ( "extension.zip" ) ;
52
+ rl . close ( ) ;
53
+ } ) ( ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 34
34
"build" : " cd js && cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics" ,
35
35
"build-debug" : " npm run build --" ,
36
36
"build-release" : " npm run build -- --release" ,
37
+ "update-lists" : " node data/update-lists.js" ,
37
38
"install" : " npm run build-release" ,
38
39
"test" : " cargo test"
39
40
}
You can’t perform that action at this time.
0 commit comments