From b5631b9a7f95bb425d074e9f55dd286f86afb6d0 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 4 Mar 2019 15:10:23 +0000 Subject: [PATCH] pre publish script to fix the needs of removing packcage --- scripts/npm-publish.sh | 2 ++ scripts/pre-publish.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 scripts/pre-publish.js diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index 96c8c1c3b4..27add99ef4 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -127,6 +127,8 @@ while [[ $1 == -* ]]; do esac done +node ./scripts/pre-publish.js + if $EXEC_BUILD == true; then echo "====== INSTALL AND CLEAN ${PACKAGE} ===== " npm install rimraf diff --git a/scripts/pre-publish.js b/scripts/pre-publish.js new file mode 100644 index 0000000000..7a761976ad --- /dev/null +++ b/scripts/pre-publish.js @@ -0,0 +1,14 @@ +var fs = require('fs'); +var file = require('../package.json'); + + +Object.keys(file.dependencies).forEach((currentDep)=>{ + + if(currentDep.indexOf("@alfresco/adf-")>=0) { + delete file.dependencies[currentDep]; + } +}); + +fs.writeFileSync('package.json', JSON.stringify(file), function (err) { + if (err) return console.log(err); +});