2018-10-28 22:01:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-10-28 22:59:15 +00:00
|
|
|
BASEDIR=$(dirname "$0")
|
2020-03-28 12:58:36 +00:00
|
|
|
# shellcheck disable=SC1090
|
2018-10-28 22:59:15 +00:00
|
|
|
source "${BASEDIR}/resolve_commands.sh"
|
2020-03-28 12:58:36 +00:00
|
|
|
cd "$BASEDIR/../" || { echo "Failed to enter parent directory!"; exit 1; }
|
2018-10-28 22:59:15 +00:00
|
|
|
|
2018-10-28 22:01:09 +00:00
|
|
|
function generate_link() {
|
2019-02-17 15:08:10 +00:00
|
|
|
if [[ ! -L $2 ]] || [[ "${BASH_ARGV[0]}" == "force" ]]; then
|
|
|
|
if [[ -e $2 ]] || [[ -L $2 ]]; then
|
2018-10-28 22:01:09 +00:00
|
|
|
rm $2
|
|
|
|
fi
|
|
|
|
ln -rs $1 $2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-11-26 20:30:08 +00:00
|
|
|
function replace_tribble() {
|
|
|
|
#${1} => file name
|
|
|
|
echo "$(cat ${1} | sed -E 's/\/\/\/[ ]+<reference [a-zA-Z.-=_ ]+\/>.*/\n/')" > ${1}
|
|
|
|
}
|
2018-12-26 13:17:12 +00:00
|
|
|
|
2018-10-28 22:01:09 +00:00
|
|
|
|
2018-12-04 18:02:45 +00:00
|
|
|
#Building the generator
|
2020-03-28 12:58:36 +00:00
|
|
|
./tools/build_dtsgen.sh; _exit_code=$?
|
|
|
|
if [[ $_exit_code -ne 0 ]]; then
|
|
|
|
echo "Failed to build typescript declaration generator ($_exit_code)"
|
2018-12-04 18:02:45 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-03-28 12:58:36 +00:00
|
|
|
#Shared
|
|
|
|
./shared/generate_declarations.sh; _exit_code=$?
|
|
|
|
[[ $_exit_code -ne 0 ]] && {
|
|
|
|
echo "Failed to generate shared ($_exit_code)"
|
2020-08-09 12:30:17 +00:00
|
|
|
}
|