pre publish script to fix the needs of removing packcage

This commit is contained in:
Eugenio Romano 2019-03-04 15:10:23 +00:00
parent d6f856f1c5
commit b5631b9a7f
2 changed files with 16 additions and 0 deletions

View File

@ -127,6 +127,8 @@ while [[ $1 == -* ]]; do
esac esac
done done
node ./scripts/pre-publish.js
if $EXEC_BUILD == true; then if $EXEC_BUILD == true; then
echo "====== INSTALL AND CLEAN ${PACKAGE} ===== " echo "====== INSTALL AND CLEAN ${PACKAGE} ===== "
npm install rimraf npm install rimraf

14
scripts/pre-publish.js Normal file
View File

@ -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);
});