Skip to content

Commit cde99aa

Browse files
committed
Use native fs.mkdir instead of mkdirp package
- Modern mkdirp has abandoned callbacks - Use native fs.mkdir instead with recursive option - Updated lock and version bump
1 parent 82a6dbb commit cde99aa

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

build.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var async = require("async");
22
var fs = require("fs");
3-
var mkdirp = require("mkdirp");
43
var moduleDeps = require("./module-deps");
54
var path = require("path");
65

@@ -155,7 +154,7 @@ function build(config, opts, callback){
155154
function createOutputFolder(opts, cb) {
156155
var output = (opts.outputFolder || ".") + "/" + (opts.outputFile || "");
157156
output = path.dirname(output);
158-
mkdirp(output, cb);
157+
fs.mkdir(output, {recursive: true}, cb);
159158
}
160159

161160
function compileLess(opts, sources, callback) {

copy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var fs = require('fs');
22
var path = require('path');
3-
var mkdirSync = require('mkdirp').sync;
3+
var mkdirSync = require('fs').mkdirsync;
44

55
function convertPath(dir){
66
if (process.platform == 'win32' && dir[0] == '/')
@@ -72,7 +72,7 @@ function copy(from, to, options) {
7272
if (options.onDir && options.onDir(from, to) === false)
7373
return;
7474
try {
75-
mkdirSync(to);
75+
mkdirSync(to, {recursive: true});
7676
} catch (e) {
7777
return options.onError(e);
7878
}
@@ -115,7 +115,7 @@ copy.file = function(from, to, replace) {
115115
write();
116116
} catch(e) {
117117
if (e.code == "ENOENT") {
118-
mkdirSync(path.dirname(to));
118+
mkdirSync(path.dirname(to), {recursive: true});
119119
write();
120120
} else {
121121
throw e;

package-lock.json

+1-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pylonide/architect-build",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Concatenates and uglifies an architect config into one file with source map and incremental update support",
55
"author": "Ajax.org B.V. <[email protected]>",
66
"license": "MIT",
@@ -24,8 +24,7 @@
2424
},
2525
"dependencies": {
2626
"through": "~2.3.8",
27-
"async": "~3.2.0",
28-
"mkdirp": "~1.0.4"
27+
"async": "~3.2.0"
2928
},
3029
"devDependencies": {},
3130
"optionalDependencies": {

0 commit comments

Comments
 (0)