Skip to content

Commit

Permalink
use glob for globbing :)
Browse files Browse the repository at this point in the history
  • Loading branch information
tevio authored and stevemartin committed Jul 12, 2016
1 parent d2c4311 commit b5dd1d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions core/lib/annotation_exporter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

var path = require('path'),
readDir = require('readdir'),
glob = require('glob'),
fs = require('fs-extra'),
JSON5 = require('json5'),
_ = require('lodash'),
Expand Down Expand Up @@ -51,8 +51,8 @@ var annotations_exporter = function (pl) {
var annotations = annotations;
var markdown_parser = parser;

return function (file) {
var annotationsMD = fs.readFileSync(path.resolve(paths.source.annotations, file), 'utf8');
return function (filePath) {
var annotationsMD = fs.readFileSync(path.resolve(filePath), 'utf8');

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

mdFiles.forEach(parseMDFile(annotations, markdown_parser));
return annotations;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"grunt": "~1.0.1",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-nodeunit": "^1.0.0",
"grunt-eslint": "^18.0.0",
"readdir": "0.0.13"
"grunt-eslint": "^18.0.0"
},
"keywords": [
"Pattern Lab",
Expand Down

0 comments on commit b5dd1d0

Please sign in to comment.