2024-04-27 16:50:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-07-05 01:27:29 +00:00
|
|
|
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
|
2024-07-05 01:27:29 +00:00
|
|
|
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
|
2024-07-05 01:27:29 +00:00
|
|
|
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}
|
2024-07-05 01:27:29 +00:00
|
|
|
;;
|
|
|
|
server)
|
|
|
|
go mod tidy
|
|
|
|
go build
|
|
|
|
;;
|
2024-07-07 17:07:18 +00:00
|
|
|
*)
|
2024-07-16 19:43:35 +00:00
|
|
|
echo "usage: ${0} <front|server>"
|
2024-07-05 01:27:29 +00:00
|
|
|
;;
|
2024-07-07 17:07:18 +00:00
|
|
|
esac
|