mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Add a test script to compile typings and test on travis (#2808)
This commit is contained in:
29
tests/scripts/compile_typings.sh
Executable file
29
tests/scripts/compile_typings.sh
Executable 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
|
||||
Reference in New Issue
Block a user