underbbs/build.sh

30 lines
540 B
Bash
Raw Normal View History

2024-04-27 16:50:27 +00:00
#!/bin/sh
case "$1" in
client)
2024-07-07 17:07:18 +00:00
if [ ! -e ./frontend/.js ]; then
mkdir ./frontend/.js
fi
buildlog=$(mktemp)
2024-07-07 17:07:18 +00:00
if [ ! -z $"{PLAN9}" ]; then
npx tsc 2>&1 | nobs | sed -e 's/\.ts\(/\.ts:/g' -e 's/,[0-9]+\)://g' > ${buildlog}
else
npx tsc 2>&1 > ${buildlog}
fi
if [ -s ${buildlog} ]; then
cat ${buildlog} | head
rm ${buildlog}
else
npx webpack --config webpack.config.js
fi
;;
server)
go mod tidy
go build
;;
2024-07-07 17:07:18 +00:00
*)
$0 client
$0 server
;;
2024-07-07 17:07:18 +00:00
esac