mirror of
https://github.com/google/blockly.git
synced 2026-01-04 23:50:12 +01:00
I had forgotten that I needed to change the value of BUILD_DIR in several different places. Added comments warning future editors about this as well as filing issue #5007 to track fixing this properly. Despite being misconfigured and therefore failing, the typescript and metadata test scripts were exiting with status 0, indicating successful completion. These have been fixed so they should fail on any error, including misconfiguration.
33 lines
821 B
Bash
Executable File
33 lines
821 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Location that npm run typings will write .d.ts files to.
|
|
#
|
|
# (TODO(#5007): Should fetch this from scripts/gulpfiles/config.js
|
|
# instead of hardcoding it here.
|
|
readonly BUILD_DIR='build'
|
|
|
|
# ANSI colors
|
|
BOLD_GREEN='\033[1;32m'
|
|
BOLD_RED='\033[1;31m'
|
|
ANSI_RESET='\033[0m'
|
|
|
|
# Terminate immediately with non-zero status if any command exits
|
|
# with non-zero status, printing a nice message.
|
|
set -e
|
|
function fail {
|
|
echo -e "${BOLD_RED}Failed to compile TypeScript typings.${ANSI_RESET}" >&2
|
|
}
|
|
trap fail ERR
|
|
|
|
# Generate Blockly typings.
|
|
echo "Generating Blockly typings"
|
|
npm run typings
|
|
|
|
# Use the TypeScript compiler to compile the generated typings.
|
|
echo "Compiling typings"
|
|
|
|
cd "${BUILD_DIR}"
|
|
../node_modules/.bin/tsc blockly.d.ts
|
|
|
|
echo -e "${BOLD_GREEN}TypeScript typings compiled successfully.${ANSI_RESET}"
|