underbbs/build.sh

29 lines
547 B
Bash
Raw Normal View History

2024-04-27 16:50:27 +00:00
#!/bin/sh
case "$1" in
2024-07-07 20:54:33 +00:00
front)
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
else
npx webpack --config webpack.config.js
fi
2024-07-07 20:54:33 +00:00
rm ${buildlog}
;;
server)
go mod tidy
go build
;;
2024-07-07 17:07:18 +00:00
*)
echo "usage: ${0} <front|server>"
;;
2024-07-07 17:07:18 +00:00
esac