initial commit

This commit is contained in:
Blue 2018-08-05 00:46:25 +03:00 committed by Юрий Губич
commit 4b60ece582
327 changed files with 28286 additions and 0 deletions

View file

@ -0,0 +1,34 @@
"use strict";
const fs = require("fs");
function pathCheck(/*Array*/path, cb) {
fs.access(path[0], function(err) {
if (err) {
if (err.code === 'ENOENT') {
fs.mkdir(path[0], function() {
if (path.length === 1) {
cb();
} else {
let nPath = path.slice();
let out = nPath.splice(1, 1);
nPath[0] += "/" + out[0];
pathCheck(nPath, cb);
}
})
} else {
cb(err);
}
} else {
if (path.length === 1) {
cb();
} else {
let nPath = path.slice();
let out = nPath.splice(1, 1);
nPath[0] += "/" + out[0];
pathCheck(nPath, cb);
}
}
})
}
module.exports = pathCheck;