in src/audit-license-headers.js [96:112]
async function getRatJar () {
const RAT_ID = 'apache-rat-0.12';
const RAT_URL = `https://archive.apache.org/dist/creadur/${RAT_ID}/${RAT_ID}-bin.tar.gz`;
const cohoRoot = repoutil.getRepoDir(repoutil.getRepoById('coho'));
const ratJarPath = path.join(cohoRoot, RAT_ID, RAT_ID + '.jar');
if (!fs.existsSync(ratJarPath)) {
console.log('RAT tool not found, downloading to: ' + ratJarPath);
await pipeline(
got.stream(RAT_URL), new Gunzip(), tar.extract(cohoRoot)
).catch(err => {
throw new Error('Failed to get RAT JAR:\n' + err.message);
});
}
return ratJarPath;
}