@@ -229,26 +229,22 @@ function saveCache(path, callback) {
229
229
}
230
230
}
231
231
232
- function loadCache ( opts , callback ) {
233
- if ( ! ( "cache" in opts ) ) {
234
- return callback ( null ) ;
235
- } else {
236
- readJSON ( opts [ "filter.cache" ] , function ( cache , err ) {
237
- if ( ! ! err ) {
238
- if ( err [ "code" ] == 'ENOENT' ) return callback ( null ) ;
239
- console . log ( err ) ;
240
- return process . abort ( ) ;
241
- } else {
242
- ids = cache || [ ] ;
243
-
244
- ids = ids . filter ( function ( id ) {
245
- return opts [ "exclude.id" ] . indexOf ( id ) == - 1 ;
246
- } ) ;
247
-
248
- return callback ( cache ) ;
249
- }
250
- } ) ;
251
- }
232
+ function loadCache ( path , callback ) {
233
+ readJSON ( opts [ "filter.cache" ] , function ( cache , err ) {
234
+ if ( ! ! err ) {
235
+ console . log ( err ) ;
236
+ if ( err [ "code" ] == 'ENOENT' ) return callback ( null ) ;
237
+ return process . abort ( ) ;
238
+ } else {
239
+ ids = cache || [ ] ;
240
+
241
+ ids = ids . filter ( function ( id ) {
242
+ return opts [ "exclude.id" ] . indexOf ( id ) == - 1 ;
243
+ } ) ;
244
+
245
+ return callback ( cache ) ;
246
+ }
247
+ } ) ;
252
248
}
253
249
254
250
function loadOpts ( callback ) {
@@ -278,7 +274,7 @@ function loadOpts(callback) {
278
274
opts [ "filter.post_type" ] . push ( "angelSight" ) ;
279
275
}
280
276
281
- loadCache ( opts , function ( ) { callback ( opts ) ; } ) ;
277
+ loadCache ( opts [ "filter.cache" ] , function ( ) { callback ( opts ) ; } ) ;
282
278
} ) ;
283
279
284
280
}
0 commit comments