mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-30 21:33:43 +03:00
30 lines
691 B
JavaScript
Executable File
30 lines
691 B
JavaScript
Executable File
'use strict';
|
|
|
|
var generator = require('./pac-generator');
|
|
|
|
var normalizedPath = require('path').join(__dirname, 'src');
|
|
|
|
var outputDir = './generated-PACs';
|
|
|
|
var fs = require('fs')
|
|
try {
|
|
fs.mkdirSync( outputDir );
|
|
} catch(e) {
|
|
if ( e.code != 'EEXIST' ) throw e;
|
|
}
|
|
|
|
fs.readdirSync( normalizedPath )
|
|
.filter( file => file.startsWith('blocked-') )
|
|
.forEach( file =>
|
|
require('./src/'+ file)(
|
|
generator.hosts,
|
|
generator.ips,
|
|
generator,
|
|
function generatePac() {
|
|
var args = [].slice.call( arguments );
|
|
args.unshift( outputDir +'/'+ file )
|
|
generator.writeOutputToFile.apply( generator, args );
|
|
}
|
|
)
|
|
);
|