Skip to content

Commit b5dd1d0

Browse files
teviostevemartin
authored andcommitted
use glob for globbing :)
1 parent d2c4311 commit b5dd1d0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

core/lib/annotation_exporter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
var path = require('path'),
4-
readDir = require('readdir'),
4+
glob = require('glob'),
55
fs = require('fs-extra'),
66
JSON5 = require('json5'),
77
_ = require('lodash'),
@@ -51,8 +51,8 @@ var annotations_exporter = function (pl) {
5151
var annotations = annotations;
5252
var markdown_parser = parser;
5353

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');
5656

5757
//take the annotation snippets and split them on our custom delimiter
5858
var annotationsYAML = annotationsMD.split('~*~');
@@ -70,7 +70,7 @@ var annotations_exporter = function (pl) {
7070
function parseAnnotationsMD() {
7171
var markdown_parser = new mp();
7272
var annotations = [];
73-
var mdFiles = readDir.readSync(paths.source.annotations, ['*.md'])
73+
var mdFiles = glob.sync(paths.source.annotations + '/*.md')
7474

7575
mdFiles.forEach(parseMDFile(annotations, markdown_parser));
7676
return annotations;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"grunt": "~1.0.1",
1818
"grunt-contrib-concat": "^1.0.1",
1919
"grunt-contrib-nodeunit": "^1.0.0",
20-
"grunt-eslint": "^18.0.0",
21-
"readdir": "0.0.13"
20+
"grunt-eslint": "^18.0.0"
2221
},
2322
"keywords": [
2423
"Pattern Lab",

0 commit comments

Comments
 (0)