TeaWeb/scripts/resolve_commands.sh

26 lines
580 B
Bash
Raw Normal View History

2018-10-28 22:59:15 +00:00
#!/usr/bin/env bash
function execute_tsc() {
if [ "$command_tsc" == "" ]; then
if [ "$node_bin" == "" ]; then
node_bin=$(npm bin)
fi
if [ ! -e "${node_bin}/tsc" ]; then
echo "Could not find tsc command"
echo "May type npm install"
exit 1
fi
command_tsc="${node_bin}/tsc"
output=$(${command_tsc} -v)
if [ $? -ne 0 ]; then
echo "Failed to execute a simple tsc command!"
echo "$output"
exit 1
fi
fi
${command_tsc} $@
}