fix: handle mkdirp0.5->1.0x so it doesn't break upgrade

v1.18.x
Baris Usakli 5 years ago
parent 157832131d
commit 1e50616c13

@ -5,7 +5,14 @@ var async = require('async');
var fs = require('fs');
const util = require('util');
var mkdirp = require('mkdirp');
var mkdirpCallback = util.callbackify(mkdirp);
var mkdirpCallback;
if (mkdirp.hasOwnProperty('native')) {
mkdirpCallback = util.callbackify(mkdirp);
} else {
mkdirpCallback = mkdirp;
mkdirp = util.promisify(mkdirp);
}
var rimraf = require('rimraf');
var file = require('../file');

@ -2,11 +2,12 @@
const path = require('path');
const fs = require('fs');
const mkdirp = require('mkdirp');
const util = require('util');
let mkdirp = require('mkdirp');
mkdirp = mkdirp.hasOwnProperty('native') ? mkdirp : util.promisify(mkdirp);
const rimraf = require('rimraf');
const _ = require('lodash');
const util = require('util');
const rimrafAsync = util.promisify(rimraf);
const writeFileAsync = util.promisify(fs.writeFile);
const readFileAsync = util.promisify(fs.readFile);

@ -2,11 +2,12 @@
const path = require('path');
const fs = require('fs');
const rimraf = require('rimraf');
const mkdirp = require('mkdirp');
const util = require('util');
const rimraf = require('rimraf');
let mkdirp = require('mkdirp');
mkdirp = mkdirp.hasOwnProperty('native') ? mkdirp : util.promisify(mkdirp);
const readdirAsync = util.promisify(fs.readdir);
const rimrafAsync = util.promisify(rimraf);
const writeFileAsync = util.promisify(fs.writeFile);

@ -1,11 +1,11 @@
'use strict';
const mkdirp = require('mkdirp');
const util = require('util');
let mkdirp = require('mkdirp');
mkdirp = mkdirp.hasOwnProperty('native') ? mkdirp : util.promisify(mkdirp);
const rimraf = require('rimraf');
const winston = require('winston');
const path = require('path');
const util = require('util');
const fs = require('fs');
const fsReadFile = util.promisify(fs.readFile);
const fsWriteFile = util.promisify(fs.writeFile);

Loading…
Cancel
Save