From 524a1a365e6adc8a12187910e81d5926aeef44b1 Mon Sep 17 00:00:00 2001 From: vamsee Date: Thu, 20 Sep 2018 18:16:07 +0530 Subject: [PATCH 1/2] removing modules with private license in postinstall --- package.json | 7 ++++--- postinstall.js | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 postinstall.js diff --git a/package.json b/package.json index c55510c..ab34472 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Node-RED nodes to connect loopback (http://loopback.io) based node applications", "main": "node-red.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "node postinstall.js" }, "repository": { "type": "git", @@ -31,8 +32,8 @@ "find-data": "find-data/find-data.js", "decision-table": "rule-engine-decision-table/decision-table.js", "oe-logger": "oe-logger/oe-logger.js", - "remote-method" : "remote-method/remote-method.js", - "execute-remote-method": "execute-remote-method/execute-remote-method.js" + "remote-method": "remote-method/remote-method.js", + "execute-remote-method": "execute-remote-method/execute-remote-method.js" } }, "author": "Atul", diff --git a/postinstall.js b/postinstall.js new file mode 100644 index 0000000..88cc681 --- /dev/null +++ b/postinstall.js @@ -0,0 +1,19 @@ +var fs = require('fs'); +var deleteFolderRecursive = function(path) { + if( fs.existsSync(path) ) { + fs.readdirSync(path).forEach(function(file,index){ + var curPath = path + "/" + file; + if(fs.lstatSync(curPath).isDirectory()) { // recurse + deleteFolderRecursive(curPath); + } else { // delete file + fs.unlinkSync(curPath); + } + }); + fs.rmdirSync(path); + } +}; +var initDir = process.env.INIT_CWD; +deleteFolderRecursive(initDir + "/node_modules/node-red-node-email"); +deleteFolderRecursive(initDir + "/node_modules/mailparser"); +deleteFolderRecursive(initDir + "/node_modules/mimelib"); +console.log("Removed node-red-node-email module"); From 2696a44edafeacaf212478100be47f1fefcf54c4 Mon Sep 17 00:00:00 2001 From: vamsee Date: Thu, 20 Sep 2018 18:18:47 +0530 Subject: [PATCH 2/2] version 1.5.0 -> 1.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab34472..964d9c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loopback-connector-nodes-for-Node-RED", - "version": "1.5.0", + "version": "1.6.0", "description": "Node-RED nodes to connect loopback (http://loopback.io) based node applications", "main": "node-red.js", "scripts": {