commit node_modules and generated files
This commit is contained in:
parent
6d7a135fea
commit
34b372292b
3379 changed files with 449603 additions and 2029 deletions
32
node_modules/find-cache-dir/index.js
generated
vendored
Normal file
32
node_modules/find-cache-dir/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const commonDir = require('commondir');
|
||||
const pkgDir = require('pkg-dir');
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
module.exports = (options = {}) => {
|
||||
const {name} = options;
|
||||
let directory = options.cwd;
|
||||
|
||||
if (options.files) {
|
||||
directory = commonDir(directory, options.files);
|
||||
} else {
|
||||
directory = directory || process.cwd();
|
||||
}
|
||||
|
||||
directory = pkgDir.sync(directory);
|
||||
|
||||
if (directory) {
|
||||
directory = path.join(directory, 'node_modules', '.cache', name);
|
||||
|
||||
if (directory && options.create) {
|
||||
makeDir.sync(directory);
|
||||
}
|
||||
|
||||
if (options.thunk) {
|
||||
return (...arguments_) => path.join(directory, ...arguments_);
|
||||
}
|
||||
}
|
||||
|
||||
return directory;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue