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

@@ -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