Add a test script to compile typings and test on travis (#2808)

This commit is contained in:
Sam El-Husseini
2019-08-13 13:49:28 -07:00
committed by GitHub
parent 74fa3bb71a
commit 7ab4bb846c
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#!/bin/bash
# ANSI colors
BOLD_GREEN='\033[1;32m'
BOLD_RED='\033[1;31m'
ANSI_RESET='\033[0m'
# Download TypeScript to obtain the compiler.
echo "Downloading TypeScript"
npm install typescript
# Generate Blockly typings.
echo "Generating Blockly typings"
npm run typings
# Use the TypeScript compiler to compile the generated typings.
echo "Compiling typings"
cd typings
../node_modules/.bin/tsc blockly.d.ts
if [ $? -eq 0 ]
then
echo -e "${BOLD_GREEN}TypeScript typings compiled successfully.${ANSI_RESET}"
exit 0
else
echo -e "${BOLD_RED}Failed to compile TypeScript typings.${ANSI_RESET}" >&2
exit 1
fi