diff --git a/Makefile b/Makefile index c6b487358..956dfff7b 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ NSP := ./node_modules/.bin/nsp NODEUNIT := ./node_modules/.bin/nodeunit MOCHA := ./node_modules/.bin/mocha NODECOVER := ./node_modules/.bin/cover -NSP_BADGE := ./tools/nspBadge.js NPM := npm # @@ -64,7 +63,7 @@ test: $(NODEUNIT) .PHONY: nsp nsp: node_modules $(NSP) - @($(NSP) check) | $(NSP_BADGE) + @($(NSP) check) | true include ./tools/mk/Makefile.deps include ./tools/mk/Makefile.targ diff --git a/README.md b/README.md index f3795359d..ef630f7f1 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,6 @@ [![Dependency Status](https://david-dm.org/restify/node-restify.svg)](https://david-dm.org/restify/node-restify) [![devDependency Status](https://david-dm.org/restify/node-restify/dev-status.svg)](https://david-dm.org/restify/node-restify#info=devDependencies) [![bitHound Score](https://www.bithound.io/github/restify/node-restify/badges/score.svg)](https://www.bithound.io/github/restify/node-restify/master) -[![NSP Status](https://img.shields.io/badge/NSP%20status-no%20vulnerabilities-green.svg)](https://travis-ci.org/restify/node-restify) - [restify](http://restify.com) is a framework, utilizing [connect](https://github.com/senchalabs/connect) style middleware for building diff --git a/tools/nspBadge.js b/tools/nspBadge.js deleted file mode 100755 index 232b32cb2..000000000 --- a/tools/nspBadge.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -var fs = require('fs'); -var path = require('path'); - -var README_PATH = path.join(__dirname, '../README.md'); -/* jscs:disable maximumLineLength */ -var FAIL_BADGE = 'vulnerabilities%20found-red'; -var SUCCESS_BADGE = 'no%20vulnerabilities-green'; -var NSP_LINE_ID = '[NSP Status]'; -/* jscs:enable maximumLineLength */ - -process.stdin.on('data', function (exitCodeBuf) { - - var nspExitCode = parseInt(exitCodeBuf.toString(), 10); - - if (isNaN(nspExitCode)) { - // output any success message - console.warn(exitCodeBuf.toString()); - nspExitCode = 0; - } - - var readmeStr = fs.readFileSync(README_PATH).toString(); - - var out = processLines(nspExitCode, readmeStr); - - // now write it back out - fs.writeFileSync(README_PATH, out); -}); - -function processLines(exitCode, readmeStr) { - var lines = readmeStr.toString().split('\n'); - var outLines = ''; - - lines.forEach(function (line) { - if (line.indexOf(NSP_LINE_ID) > -1) { - if (exitCode === 0) { - outLines += line.replace(FAIL_BADGE, SUCCESS_BADGE) + '\n'; - } else { - outLines += line.replace(SUCCESS_BADGE, FAIL_BADGE) + '\n'; - } - } else { - outLines += line + '\n'; - } - }); - - // chop off last newline - return outLines.slice(0, -1); -}