multi-tasks 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ let pathutil = require('path');
|
|
|
3
3
|
const { spawn, exec } = require('child_process');
|
|
4
4
|
let SuperConsumer = require('../index').SuperConsumer;
|
|
5
5
|
let localUtil = require('./util');
|
|
6
|
-
const makeDir = require('
|
|
6
|
+
const makeDir = require('../utils/makedir');
|
|
7
7
|
|
|
8
8
|
let thisroot = pathutil.parse(__filename).dir;
|
|
9
9
|
let garbagedir = pathutil.resolve(thisroot,`./tmp-garbage`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let fs = require('fs');
|
|
2
2
|
let pathutil = require('path');
|
|
3
|
-
let makeDir = require('
|
|
3
|
+
let makeDir = require('../utils/makedir');
|
|
4
4
|
let RunnerProducer = require('./RunnerProducer');//switch to require from node_modules in your project
|
|
5
5
|
let RunnerConsumer = require('./RunnerConsumer');//switch to require from node_modules in your project
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "multi-tasks",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"multithread"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"make-dir":"^3.1.0"
|
|
19
18
|
},
|
|
20
19
|
"author": "zhanglei923@gmail.com",
|
|
21
20
|
"license": "MIT"
|
package/utils/makedir.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
function sync(directoryPath) {
|
|
5
|
+
directoryPath = directoryPath.replace(/\\/g, '/');
|
|
6
|
+
|
|
7
|
+
const directories = directoryPath.split('/');
|
|
8
|
+
|
|
9
|
+
let currentPath = '';
|
|
10
|
+
for (let directory of directories) {
|
|
11
|
+
currentPath = path.join(currentPath, directory);
|
|
12
|
+
if (!fs.existsSync(currentPath)) {
|
|
13
|
+
try {
|
|
14
|
+
fs.mkdirSync(currentPath);
|
|
15
|
+
} catch (err) {
|
|
16
|
+
if (err.code !== 'EEXIST') {
|
|
17
|
+
throw err;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = {sync};
|
package/workers/SuperProducer.js
CHANGED