storage-upload/test.js
TheThing c476ef7b18
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
Add Appveyor test, update readme
2022-01-11 07:23:27 +00:00

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()