@@ -22,18 +22,16 @@ var shred = function(shredOptions) {
22
22
23
23
var shredSingleDir = function ( shredOptions , filePath ) {
24
24
shredOptions = resolveShredOptions ( shredOptions ) ;
25
- var root = path . resolve ( shredOptions . basePath , shredOptions . examplesDir ) ;
26
25
var fileDir = path . dirname ( filePath ) ;
27
- var relativePath = path . relative ( root , fileDir ) ;
26
+ var relativePath = path . relative ( shredOptions . examplesDir , fileDir ) ;
28
27
var examplesDir = path . join ( shredOptions . examplesDir , relativePath ) ;
29
28
var fragmentsDir = path . join ( shredOptions . fragmentsDir , relativePath ) ;
30
29
var options = {
31
- basePath : shredOptions . basePath ,
32
30
includeSubdirs : false ,
33
31
examplesDir : examplesDir ,
34
32
fragmentsDir : fragmentsDir
35
33
}
36
- var cleanPath = path . join ( shredOptions . basePath , fragmentsDir , '*.*' )
34
+ var cleanPath = path . join ( fragmentsDir , '*.*' )
37
35
return delPromise ( [ cleanPath , '!**/*.ovr.*' ] ) . then ( function ( paths ) {
38
36
// console.log('Deleted files/folders:\n', paths.join('\n'));
39
37
return shred ( options ) ;
@@ -74,7 +72,7 @@ function createShredPackage(shredOptions) {
74
72
// default configs - may be overriden
75
73
. config ( function ( readFilesProcessor ) {
76
74
// Specify the base path used when resolving relative paths to source and output files
77
- readFilesProcessor . basePath = options . basePath ;
75
+ readFilesProcessor . basePath = "/" ;
78
76
79
77
// Specify collections of source files that should contain the documentation to extract
80
78
var extns = [ '*.js' , '*.html' , '*.ts' , '*.css' , '*.json' ] ;
@@ -120,7 +118,7 @@ var createShredMapPackage = function(mapOptions) {
120
118
// default configs - may be overriden
121
119
. config ( function ( readFilesProcessor ) {
122
120
// Specify the base path used when resolving relative paths to source and output files
123
- readFilesProcessor . basePath = options . basePath ;
121
+ readFilesProcessor . basePath = '/' ; // options.basePath;
124
122
125
123
// Specify collections of source files that should contain the documentation to extract
126
124
var extns = [ '*.jade' ] ;
@@ -184,23 +182,21 @@ var createShredMapPackage = function(mapOptions) {
184
182
185
183
function resolveShredOptions ( shredOptions ) {
186
184
return _ . defaults ( { } , shredOptions , {
187
- basePath : path . resolve ( '.' ) ,
188
185
// read files from any subdir under here
189
- examplesDir : " docs/_examples",
186
+ examplesDir : path . resolve ( "./ docs/_examples") ,
190
187
// shredded files get copied here with same subdir structure.
191
- fragmentsDir : " docs/_fragments",
188
+ fragmentsDir : path . resolve ( "./ docs/_fragments") ,
192
189
// whether to include subdirectories when shredding.
193
190
includeSubdirs : true
194
191
} ) ;
195
192
}
196
193
197
194
function resolveMapOptions ( mapOptions ) {
198
195
return _ . defaults ( { } , mapOptions , {
199
- basePath : path . resolve ( '.' ) ,
200
196
// read files from any subdir under here
201
- jadeDir : " docs",
202
- fragmentsDir : " docs/_fragments",
203
- examplesDir : " docs/_examples",
197
+ jadeDir : path . resolve ( "./ docs") ,
198
+ fragmentsDir : path . resolve ( "./ docs/_fragments") ,
199
+ examplesDir : path . resolve ( "./ docs/_examples") ,
204
200
// whether to include subdirectories when shredding.
205
201
includeSubdirs : true
206
202
} ) ;
0 commit comments