Skip to content

Instantly share code, notes, and snippets.

View rundef's full-sized avatar

Mickael Burguet rundef

View GitHub Profile
@rundef
rundef / merge-nyc-code-coverage-reports.js
Last active December 22, 2020 16:45
Script to merge multiple nyc/istanbul code coverage json reports into a single html report: http://rundef.com/typescript-code-coverage-istanbul-nyc
var path = require('path'),
fs = require('fs'),
libCoverage = require('nyc/node_modules/istanbul-lib-coverage'),
libReport = require('nyc/node_modules/istanbul-lib-report'),
reports = require('nyc/node_modules/istanbul-reports');
var rootFolder = __dirname;
var mergeIntoFolder = 'final';
var files = fs.readdirSync(rootFolder);
var mergedCoverageMap = null;
add_filter('http_request_args', 'dm_prevent_update_check', 10, 2);
function dm_prevent_update_check( $r, $url ) {
if (strpos($url, 'http://api.wordpress.org/plugins/update-check/1.1/') === 0 || strpos($url, 'https://api.wordpress.org/plugins/update-check/1.1/') === 0) {
$my_plugin = plugin_basename(__FILE__);
$plugins = json_decode($r['body']['plugins'], true);
if(isset($plugins['plugins'][$my_plugin]))
unset($plugins['plugins'][$my_plugin]);
$k = array_search($my_plugin, $plugins['active']);
if($k !== FALSE)
unset($plugins['active'][$k]);