Skip to content

Commit 5ac22b1

Browse files
committed
Merge pull request #3 from apibyexample/bug/recursive-create-directory
Fixes an issue where mkdir was unable to resursive create directories.
2 parents 920772a + e65a5ec commit 5ac22b1

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"test": "grunt test"
88
},
99
"keywords": [
10-
"abe",
11-
"mocks",
12-
"json"
10+
"abe",
11+
"mocks",
12+
"json"
1313
],
1414
"repository": {
1515
"type": "git",
@@ -34,6 +34,7 @@
3434
"grunt-cli": "~0.1.13",
3535
"grunt-contrib-jshint": "~0.10.0",
3636
"grunt-jscs": "~0.7.1",
37-
"load-grunt-tasks": "~0.6.0"
37+
"load-grunt-tasks": "~0.6.0",
38+
"mkdirp": "~0.5.0"
3839
}
3940
}

src/abe-json-builder.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
var colors = require('colours'),
2+
fs = require('fs'),
23
glob = require('glob'),
4+
lodash = require('lodash-node'),
5+
mkdirp = require('mkdirp'),
36
path = require('path'),
47
util = require('util'),
5-
lodash = require('lodash-node'),
6-
fs = require('fs'),
78
errors = {
8-
'NOT_ABE': 'This file isn\'t valid ABE JSON format'
9+
'NOT_ABE': 'This file is an invalid ABE JSON format'
910
},
1011
opt = {
1112
'verbose': false,
@@ -35,7 +36,7 @@ exports.jsonBuilder = function (options) {
3536
baseName = path.basename(match, '.json');
3637

3738
if (!fs.existsSync(filePath)) {
38-
fs.mkdir(filePath, function (err) {
39+
mkdirp(filePath, function (err) {
3940
if (err) {
4041
console.log(err.red);
4142
} else if (opt.verbose) {

0 commit comments

Comments
 (0)