File tree 3 files changed +7
-19
lines changed
3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,6 @@ function withIncludes(include_paths) {
6
6
return buildFiles ( include_paths ) ;
7
7
}
8
8
9
- // Returns file paths based on the exclude_paths values in config file
10
- function withExcludes ( exclude_paths ) {
11
- var allFiles = glob . sync ( "/code/**/**" , { } ) ;
12
- var excludedFiles = buildFiles ( exclude_paths ) ;
13
-
14
- return diff ( allFiles , excludedFiles ) ;
15
- }
16
-
17
9
// Returns all the file paths in the main directory that match the given pattern
18
10
function buildFiles ( paths ) {
19
11
var files = [ ] ;
@@ -35,7 +27,6 @@ function filterFiles(paths) {
35
27
36
28
module . exports = {
37
29
withIncludes : withIncludes ,
38
- withExcludes : withExcludes ,
39
30
filterFiles : filterFiles
40
31
} ;
41
32
Original file line number Diff line number Diff line change @@ -11,18 +11,20 @@ function FixMe() { }
11
11
12
12
FixMe . prototype . runEngine = function ( ) {
13
13
var analysisFiles = [ ] ,
14
+ config = {
15
+ include_paths : [ "./" ]
16
+ } ,
14
17
self = this ;
15
18
16
19
if ( fs . existsSync ( '/config.json' ) ) {
17
- var engineConfig = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
20
+ var overrides = JSON . parse ( fs . readFileSync ( '/config.json' ) ) ;
18
21
19
- if ( engineConfig . hasOwnProperty ( 'include_paths' ) ) {
20
- analysisFiles = fileBuilder . withIncludes ( engineConfig . include_paths ) ;
21
- } else if ( engineConfig . hasOwnProperty ( 'exclude_paths' ) ) {
22
- analysisFiles = fileBuilder . withExcludes ( engineConfig . exclude_paths ) ;
22
+ for ( var prop in overrides ) {
23
+ config [ prop ] = overrides [ prop ] ;
23
24
}
24
25
}
25
26
27
+ analysisFiles = fileBuilder . withIncludes ( config . include_paths ) ;
26
28
analysisFiles = fileBuilder . filterFiles ( analysisFiles ) ;
27
29
28
30
analysisFiles . forEach ( function ( f , i , a ) {
Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ describe("fileBuilder", function(){
7
7
// expect();
8
8
} ) ;
9
9
} ) ;
10
- describe ( "#withExcludes(paths)" , function ( ) {
11
- xit ( "returns correct files" , function ( ) {
12
- // expect();
13
- } ) ;
14
- } ) ;
15
10
describe ( "#filterFiles(paths)" , function ( ) {
16
11
xit ( "returns filters out directory paths" , function ( ) {
17
12
// expect();
You can’t perform that action at this time.
0 commit comments