Skip to content

Commit

Permalink
Use native fs.mkdir instead of mkdirp package
Browse files Browse the repository at this point in the history
- Modern mkdirp has abandoned callbacks
- Use native fs.mkdir instead with recursive option
- Updated lock and version bump
  • Loading branch information
exsilium committed Apr 11, 2021
1 parent 82a6dbb commit cde99aa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var async = require("async");
var fs = require("fs");
var mkdirp = require("mkdirp");
var moduleDeps = require("./module-deps");
var path = require("path");

Expand Down Expand Up @@ -155,7 +154,7 @@ function build(config, opts, callback){
function createOutputFolder(opts, cb) {
var output = (opts.outputFolder || ".") + "/" + (opts.outputFile || "");
output = path.dirname(output);
mkdirp(output, cb);
fs.mkdir(output, {recursive: true}, cb);
}

function compileLess(opts, sources, callback) {
Expand Down
6 changes: 3 additions & 3 deletions copy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var fs = require('fs');
var path = require('path');
var mkdirSync = require('mkdirp').sync;
var mkdirSync = require('fs').mkdirsync;

function convertPath(dir){
if (process.platform == 'win32' && dir[0] == '/')
Expand Down Expand Up @@ -72,7 +72,7 @@ function copy(from, to, options) {
if (options.onDir && options.onDir(from, to) === false)
return;
try {
mkdirSync(to);
mkdirSync(to, {recursive: true});
} catch (e) {
return options.onError(e);
}
Expand Down Expand Up @@ -115,7 +115,7 @@ copy.file = function(from, to, replace) {
write();
} catch(e) {
if (e.code == "ENOENT") {
mkdirSync(path.dirname(to));
mkdirSync(path.dirname(to), {recursive: true});
write();
} else {
throw e;
Expand Down
7 changes: 1 addition & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pylonide/architect-build",
"version": "0.1.2",
"version": "0.1.3",
"description": "Concatenates and uglifies an architect config into one file with source map and incremental update support",
"author": "Ajax.org B.V. <[email protected]>",
"license": "MIT",
Expand All @@ -24,8 +24,7 @@
},
"dependencies": {
"through": "~2.3.8",
"async": "~3.2.0",
"mkdirp": "~1.0.4"
"async": "~3.2.0"
},
"devDependencies": {},
"optionalDependencies": {
Expand Down

0 comments on commit cde99aa

Please sign in to comment.