#!/bin/sh case "$1" in client) if [ ! -e ./src ]; then mkdir ./src fi buildlog=$(mktemp) npx tsc 2>&1 | nobs | sed -e 's/\.ts\(/\.ts:/g' -e 's/,[0-9]+\)://g' > ${buildlog} if [ -s ${buildlog} ]; then cat ${buildlog} | head rm ${buildlog} else npx webpack --config webpack.config.js fi ;; server) go mod tidy go build ;; both) $0 client $0 server ;; *) echo "USAGE: ${0} " ;; esac