1
1
"use strict" ;
2
2
3
3
var path = require ( 'path' ) ,
4
- readDir = require ( 'readdir ' ) ,
4
+ glob = require ( 'glob ' ) ,
5
5
fs = require ( 'fs-extra' ) ,
6
6
JSON5 = require ( 'json5' ) ,
7
7
_ = require ( 'lodash' ) ,
@@ -51,8 +51,8 @@ var annotations_exporter = function (pl) {
51
51
var annotations = annotations ;
52
52
var markdown_parser = parser ;
53
53
54
- return function ( file ) {
55
- var annotationsMD = fs . readFileSync ( path . resolve ( paths . source . annotations , file ) , 'utf8' ) ;
54
+ return function ( filePath ) {
55
+ var annotationsMD = fs . readFileSync ( path . resolve ( filePath ) , 'utf8' ) ;
56
56
57
57
//take the annotation snippets and split them on our custom delimiter
58
58
var annotationsYAML = annotationsMD . split ( '~*~' ) ;
@@ -70,7 +70,7 @@ var annotations_exporter = function (pl) {
70
70
function parseAnnotationsMD ( ) {
71
71
var markdown_parser = new mp ( ) ;
72
72
var annotations = [ ] ;
73
- var mdFiles = readDir . readSync ( paths . source . annotations , [ ' *.md'] )
73
+ var mdFiles = glob . sync ( paths . source . annotations + '/ *.md')
74
74
75
75
mdFiles . forEach ( parseMDFile ( annotations , markdown_parser ) ) ;
76
76
return annotations ;
0 commit comments