Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove mkdirp dep #3108

Merged
merged 2 commits into from Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/extensions.js
Expand Up @@ -4,11 +4,10 @@

var eol = require('os').EOL,
fs = require('fs'),
pkg = require('../package.json'),
mkdir = require('mkdirp'),
path = require('path'),
defaultBinaryDir = path.join(__dirname, '..', 'vendor'),
trueCasePathSync = require('true-case-path');
trueCasePathSync = require('true-case-path'),
pkg = require('../package.json'),
defaultBinaryDir = path.join(__dirname, '..', 'vendor');

/**
* Get the human readable name of the Platform that is running
Expand Down Expand Up @@ -352,7 +351,7 @@ function getBinaryCachePath() {
cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);

try {
mkdir.sync(cachePath);
fs.mkdirSync(cachePath, {recursive: true});
return cachePath;
} catch (e) {
// Directory is not writable, try another
Expand Down
5 changes: 2 additions & 3 deletions lib/render.js
Expand Up @@ -4,7 +4,6 @@

var chalk = require('chalk'),
fs = require('fs'),
mkdirp = require('mkdirp'),
path = require('path'),
sass = require('./');

Expand Down Expand Up @@ -66,7 +65,7 @@ module.exports = function(options, emitter) {

emitter.emit('info', chalk.green('Rendering Complete, saving .css file...'));

mkdirp(path.dirname(destination), function(err) {
fs.mkdir(path.dirname(destination), {recursive: true}, function(err) {
if (err) {
return emitter.emit('error', chalk.red(err));
}
Expand All @@ -85,7 +84,7 @@ module.exports = function(options, emitter) {
if (sourceMap) {
todo++;

mkdirp(path.dirname(sourceMap), function(err) {
fs.mkdir(path.dirname(sourceMap), {recursive: true}, function(err) {
if (err) {
return emitter.emit('error', chalk.red(err));
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -61,7 +61,6 @@
"glob": "^7.0.3",
"lodash": "^4.17.15",
"meow": "^9.0.0",
"mkdirp": "^0.5.1",
"nan": "^2.13.2",
"node-gyp": "^7.1.0",
"npmlog": "^4.0.0",
Expand Down
3 changes: 1 addition & 2 deletions scripts/build.js
Expand Up @@ -3,7 +3,6 @@
*/

var fs = require('fs'),
mkdir = require('mkdirp'),
path = require('path'),
spawn = require('cross-spawn'),
sass = require('../lib/extensions');
Expand All @@ -24,7 +23,7 @@ function afterBuild(options) {
: 'Release',
'binding.node');

mkdir(path.dirname(install), function(err) {
fs.mkdir(path.dirname(install), {recursive: true}, function(err) {
if (err && err.code !== 'EEXIST') {
console.error(err.message);
return;
Expand Down
7 changes: 3 additions & 4 deletions scripts/install.js
Expand Up @@ -4,11 +4,10 @@

var fs = require('fs'),
eol = require('os').EOL,
mkdir = require('mkdirp'),
path = require('path'),
sass = require('../lib/extensions'),
request = require('request'),
log = require('npmlog'),
sass = require('../lib/extensions'),
downloadOptions = require('./util/downloadoptions');

/**
Expand Down Expand Up @@ -111,7 +110,7 @@ function checkAndDownloadBinary() {
}

try {
mkdir.sync(path.dirname(binaryPath));
fs.mkdirSync(path.dirname(binaryPath), {recursive: true});
} catch (err) {
console.error('Unable to save binary', path.dirname(binaryPath), ':', err);
return;
Expand All @@ -137,7 +136,7 @@ function checkAndDownloadBinary() {
console.log('Caching binary to', cachedBinary);

try {
mkdir.sync(path.dirname(cachedBinary));
fs.mkdirSync(path.dirname(cachedBinary), {recursive: true});
fs.createReadStream(binaryPath)
.pipe(fs.createWriteStream(cachedBinary))
.on('error', function (err) {
Expand Down