File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ var program = require('commander')
1111 , Scraper = thresher . Scraper
1212 , ep = require ( '../lib/eventparse.js' )
1313 , loglevels = require ( '../lib/loglevels.js' )
14- , outformat = require ( '../lib/outformat.js' ) ;
14+ , outformat = require ( '../lib/outformat.js' )
15+ , sanitize = require ( 'sanitize-filename' ) ;
1516
1617
1718var pjson = require ( '../package.json' ) ;
@@ -223,7 +224,7 @@ var processUrl = function(url) {
223224
224225 // url-specific output dir
225226 var dir = program . numberdirs ? ( '' + i ) : url . replace ( / \/ + / g, '_' ) . replace ( / : / g, '' ) ;
226- dir = path . join ( tld , dir ) ;
227+ dir = sanitize ( path . join ( tld , dir ) ) ;
227228 if ( ! fs . existsSync ( dir ) ) {
228229 log . debug ( 'creating output directory: ' + dir ) ;
229230 fs . mkdirSync ( dir ) ;
Original file line number Diff line number Diff line change 3131 "moment" : " ~2.10.2" ,
3232 "thresher" : " ^0.1.11" ,
3333 "which" : " ~1.0.5" ,
34- "winston" : " ~1.0.0"
34+ "winston" : " ~1.0.0" ,
35+ "sanitize-filename" : " 1.6.0"
3536 },
3637 "bin" : {
3738 "quickscrape" : " bin/quickscrape.js"
You can’t perform that action at this time.
0 commit comments