TheThing
c476ef7b18
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
27 lines
No EOL
678 B
JavaScript
27 lines
No EOL
678 B
JavaScript
const fs = require('fs');
|
|
const os = require('os');
|
|
const path = require('path');
|
|
|
|
const env = process.env;
|
|
|
|
const mkdirSync = function (dirPath) {
|
|
try {
|
|
fs.mkdirSync(dirPath, { recursive: true });
|
|
} catch (err) {
|
|
/* istanbul ignore next */
|
|
if (err.code !== 'EEXIST') {
|
|
throw err;
|
|
}
|
|
}
|
|
};
|
|
|
|
const cachePath = function () {
|
|
const npmCachePath = env.npm_config_cache || /* istanbul ignore next */
|
|
(env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(os.homedir(), '.npm'));
|
|
mkdirSync(npmCachePath);
|
|
const libvipsCachePath = path.join(npmCachePath, '_libvips');
|
|
mkdirSync(libvipsCachePath);
|
|
return libvipsCachePath;
|
|
};
|
|
|
|
cachePath() |