2024-04-27 16:50:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-07-05 01:27:29 +00:00
|
|
|
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} <client|server|both>"
|
|
|
|
;;
|
|
|
|
esac
|