embark/scripts/coverage-collector.js

13 lines
354 B
JavaScript

/* global process require */
const fs = require('fs');
const path = require('path');
const source = path.join(process.cwd(), 'coverage/coverage-final.json');
const pkgName = path.basename(process.cwd());
const destination = path.join(process.argv[2], `coverage-${pkgName}.json`);
if (fs.existsSync(source)) {
fs.copyFileSync(source, destination);
}