node-filename-to-dist-paths
Version:
Converts files from https://nodejs.org/dist/index-cjson into relative distribution paths for download from https://nodejs.org/dist/
19 lines (16 loc) • 447 B
JavaScript
var Cache = require('fetch-json-cache');
var constants = require('../assets/constants.cjs');
function cache(callback) {
var cache = new Cache(constants.CACHE_PATH);
cache.get(constants.DISTS_URL, { force: true }, callback);
}
// run patch
cache(function (err) {
if (err) {
console.log('postinstall failed. Error: ' + err.message);
process.exit(-1);
} else {
console.log('postinstall succeeded');
process.exit(0);
}
});