mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
check bundles script
This commit is contained in:
parent
2ea5e8d0e0
commit
2ac6439bb4
@ -210,3 +210,15 @@ For development environment configuration please refer to [project docs](../demo
|
||||
| --- | --- |
|
||||
| -h or --help | show the help |
|
||||
| -sd or --skipDemo | skip the demo folder clean |
|
||||
|
||||
# npm-check-bundles.sh
|
||||
|
||||
***npm-check-bundles.sh*** check the bundles in the package npm are present
|
||||
|
||||
## Options
|
||||
|
||||
| Option | Description |
|
||||
| --- | --- |
|
||||
| -h or --help | show the help |
|
||||
| -r or --registry | against which register you want do this check |
|
||||
| -v or --version | the version of the components to check |
|
||||
|
88
scripts/npm-check-bundles.sh
Executable file
88
scripts/npm-check-bundles.sh
Executable file
@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
eval VERSION=""
|
||||
|
||||
eval projects=( "ng2-alfresco-core"
|
||||
"ng2-alfresco-datatable"
|
||||
"ng2-activiti-diagrams"
|
||||
"ng2-activiti-analytics"
|
||||
"ng2-activiti-form"
|
||||
"ng2-activiti-tasklist"
|
||||
"ng2-activiti-processlist"
|
||||
"ng2-alfresco-documentlist"
|
||||
"ng2-alfresco-login"
|
||||
"ng2-alfresco-search"
|
||||
"ng2-alfresco-social"
|
||||
"ng2-alfresco-tag"
|
||||
"ng2-alfresco-social"
|
||||
"ng2-alfresco-upload"
|
||||
"ng2-alfresco-viewer"
|
||||
"ng2-alfresco-webscript"
|
||||
"ng2-alfresco-userinfo" )
|
||||
|
||||
show_help() {
|
||||
echo "Usage: npm-check-bundles.sh"
|
||||
echo "-r or -registry to check -r 'http://npm.local.me:8080/' "
|
||||
echo "-v or -version to check -v 1.4.0 "
|
||||
echo ""
|
||||
}
|
||||
|
||||
change_registry() {
|
||||
echo $1
|
||||
npm set registry $1
|
||||
}
|
||||
|
||||
set_npm_registry() {
|
||||
npm set registry https://registry.npmjs.org/
|
||||
}
|
||||
|
||||
version() {
|
||||
VERSION=$1
|
||||
}
|
||||
|
||||
error_out() {
|
||||
printf '\033[%sm%s\033[m\n' "$@"
|
||||
# usage color "31;5" "string"
|
||||
# 0 default
|
||||
# 5 blink, 1 strong, 4 underlined
|
||||
# fg: 31 red, 32 green, 33 yellow, 34 blue, 35 purple, 36 cyan, 37 white
|
||||
# bg: 40 black, 41 red, 44 blue, 45 purple
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-h|--help|-\?) show_help; exit 0;;
|
||||
-r) change_registry $2; shift 2;;
|
||||
-v|--version) version $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm -rf temp
|
||||
mkdir temp
|
||||
cd temp
|
||||
|
||||
for PACKAGE in ${projects[@]}
|
||||
do
|
||||
mkdir $PACKAGE
|
||||
cd $PACKAGE
|
||||
npm pack $PACKAGE@$VERSION
|
||||
tar zxf $PACKAGE-$VERSION.tgz
|
||||
if [ ! -f package/bundles/$PACKAGE.js ]; then
|
||||
error_out '31;1' "$PACKAGE bundles not found!" >&2
|
||||
cd $DIR
|
||||
rm -rf temp
|
||||
exit 1
|
||||
else
|
||||
echo "bundles ok!"
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
|
||||
cd $DIR
|
||||
rm -rf temp
|
||||
|
||||
set_npm_registry
|
||||
|
Loading…
x
Reference in New Issue
Block a user