Files
angular-docs-cn/test.sh
T

29 lines
787 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e -o pipefail
2016-06-14 13:06:16 -07:00
if [ $# -eq 0 ]
then
echo "Angular test runner. (No platform specified)"
echo
echo "./test.sh [node|browser|browserNoRouter|router|tools]"
2016-06-14 13:06:16 -07:00
echo
else
cd `dirname $0`
rm -rf dist/tools
if [ -z ${NODE_PATH+x} ]; then
export NODE_PATH=$(pwd)/dist/all:$(pwd)/dist/tools
else
export NODE_PATH=$NODE_PATH:$(pwd)/dist/all/:$(pwd)/dist/tools/
fi
2016-11-23 14:23:05 -08:00
echo "Compiling tools..."
2016-06-14 13:06:16 -07:00
$(npm bin)/tsc -p tools
2016-11-23 14:23:05 -08:00
if [[ $1 == 'node' ]]; then
# Note: .metadata.json files are needed for the language service tests!
echo "Creating .metadata.json files..."
2017-03-08 15:53:45 -08:00
node dist/tools/@angular/tsc-wrapped/src/main -p packages
2016-11-23 14:23:05 -08:00
node dist/tools/@angular/tsc-wrapped/src/main -p modules
fi
2016-06-14 13:06:16 -07:00
node dist/tools/tsc-watch/ $1 watch
fi