mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* fix sourcemap fix relative path and pre publish build change travis wait all test run build and remove unused cpx * global test task modify publish script to accept options * appveyor run * different approach single test run * make it work the analytics test modify start demo shell script to use a different registry * sourcemap demo shell working * update readme and add install after any clean add registry option in start.sh script add develop and normal mode in demo shell add -d option in start.sh to point to the local components add -c option in build script to point to the local components
99 lines
2.2 KiB
Bash
Executable File
99 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
eval EXEC_INSTALL=false
|
|
eval EXEC_UPDATE=false
|
|
eval EXEC_CLEAN=false
|
|
eval EXEC_DEVELOP=false
|
|
|
|
show_help() {
|
|
echo "Usage: start.sh"
|
|
echo ""
|
|
echo "-d or -develop start the demo shell using the relative ng2-components folder to link the components"
|
|
echo "-i or -install start the demo shell and install the dependencies"
|
|
echo "-u or -update start the demo shell and update the dependencies"
|
|
echo "-c or -clean clean the demo shell and reinstall the dependencies"
|
|
echo "-r or -registry to download the packages from an alternative npm registry example -registry 'http://npm.local.me:8080/' "
|
|
}
|
|
|
|
install() {
|
|
EXEC_INSTALL=true
|
|
}
|
|
|
|
update() {
|
|
EXEC_UPDATE=true
|
|
}
|
|
|
|
develop() {
|
|
EXEC_DEVELOP=true
|
|
}
|
|
|
|
change_registry(){
|
|
NPM_REGISTRY=$1
|
|
|
|
if [[ "${NPM_REGISTRY}" == "" ]]
|
|
then
|
|
echo "NPM registry required WITH OPTION -r | -registry"
|
|
exit 0
|
|
fi
|
|
|
|
echo "====== CHANGE REGISTRY: ${NPM_REGISTRY} ====="
|
|
npm config set registry ${NPM_REGISTRY}
|
|
}
|
|
|
|
clean() {
|
|
EXEC_CLEAN=true
|
|
EXEC_INSTALL=true
|
|
}
|
|
|
|
while [[ $1 == -* ]]; do
|
|
case "$1" in
|
|
-h|--help|-\?) show_help; exit 0;;
|
|
-i|--install) install; shift;;
|
|
-u|--update) update; shift;;
|
|
-c|--clean) clean; shift;;
|
|
-d|--develop) develop; shift;;
|
|
-r|--registry) change_registry $2; shift 2;;
|
|
-*) shift;;
|
|
esac
|
|
done
|
|
|
|
if $EXEC_CLEAN == true; then
|
|
echo "====== Clean Demo shell ====="
|
|
cd "$DIR/../demo-shell-ng2"
|
|
npm install rimraf
|
|
npm run clean
|
|
fi
|
|
|
|
if $EXEC_DEVELOP == true; then
|
|
echo "====== Build ng2-components folder====="
|
|
cd "$DIR/../scripts"
|
|
sh npm-build-all.sh
|
|
fi
|
|
|
|
if $EXEC_INSTALL == true; then
|
|
echo "====== Install Demo shell ====="
|
|
cd "$DIR/../demo-shell-ng2"
|
|
npm install
|
|
fi
|
|
|
|
if $EXEC_UPDATE == true; then
|
|
echo "====== Update Demo shell ====="
|
|
cd "$DIR/../demo-shell-ng2"
|
|
npm update
|
|
fi
|
|
|
|
if $EXEC_DEVELOP == true; then
|
|
echo "====== Start Demo shell development mode====="
|
|
cd "$DIR/../demo-shell-ng2"
|
|
npm run start:dev
|
|
fi
|
|
|
|
if $EXEC_DEVELOP == false; then
|
|
echo "====== Start Demo shell ====="
|
|
cd "$DIR/../demo-shell-ng2"
|
|
npm run start
|
|
fi
|
|
|