🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

fs-path

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-path - npm Package Compare versions

Comparing version

to
0.0.20

38

lib/index.js

@@ -16,27 +16,21 @@ "use strict";

mkdir: function (dist, callback) {
var that = this;
var dirs = [];
dist = path.resolve(dist);
fs.exists(dist, function (exists) {
if (!exists) {
if (that._win32) {
fsPath.mkdir(path.dirname(dist), function (err) {
if (err) {
callback && callback(err);
} else {
fs.mkdir(dist, function (err) {
if (err.code === 'EEXIST') {
err = null;
}
callback && callback(err);
});
}
});
dist.split(/[\\\/]/).reduce(function (first, second) {
var _path = path.join(first || '/', second);
dirs.push(_path);
return _path;
});
async.eachSeries(dirs, function (_path, callback) {
fs.exists(_path, function (exists) {
if (exists) {
callback(null);
} else {
child_process.exec('mkdir -p ' + dist.replace(/ /g, '\\ '), function (error, stdout, stderr) {
callback && callback(error);
fs.mkdir(_path, function (err) {
callback(!err || err.code === 'EEXIST' ? null : err);
});
}
} else {
callback && callback(null);
}
});
}, function (err) {
callback && callback(err);
});

@@ -68,3 +62,3 @@ },

// linux or mac
cmd = 'cp -r ' + from.replace(/ /g, '\\ ') + ' ' + dist.replace(/ /g, '\\ ');
cmd = 'cp -f -R ' + from.replace(/ /g, '\\ ') + ' ' + dist.replace(/ /g, '\\ ');
}

@@ -71,0 +65,0 @@ child_process.exec(cmd, function (error, stdout, stderr) {

{
"name": "fs-path",
"version": "0.0.19",
"version": "0.0.20",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "author": {