fix pacakge json social and add force option publish script

This commit is contained in:
eromano
2017-05-03 14:38:37 +02:00
committed by Eugenio Romano
parent 0b246b8211
commit b47a5e49c0
2 changed files with 26 additions and 4 deletions

View File

@@ -14,9 +14,7 @@
"coverage": "npm run test && ../node_modules/wsrv/bin/wsrv -o -p 9875 ./coverage/report",
"publish:prod": "npm run test && npm publish"
},
"main": "./index.js",
"module": "./index.js",
"typings": "./index.d.ts",
"main": "bundles/ng2-alfresco-social.js",
"repository": {
"type": "git",
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"

View File

@@ -3,6 +3,25 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"$DIR/npm-clean.sh"
eval FORCE_PUBLISH=false
show_help() {
echo "Usage: npm-publish.sh"
echo ""
echo "-f or -force publish the package with force"
}
enable_force(){
FORCE_PUBLISH=true
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-f|--force) enable_force; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
for PACKAGE in \
ng2-alfresco-core \
@@ -27,6 +46,11 @@ do
cd ${DESTDIR}
npm run clean
npm install
npm run publish:prod
if FORCE_PUBLISH == false; then
npm run publish:prod
fi
if FORCE_PUBLISH == true; then
npm run test && npm run publish --force || exit 1
fi
cd ${DIR}
done