PeerTube/scripts/dev/server.sh

26 lines
720 B
Bash
Raw Normal View History

2020-02-19 01:56:24 -06:00
#!/bin/bash
2018-03-27 03:35:12 -05:00
set -eu
2017-06-11 04:29:03 -05:00
2019-11-29 06:36:40 -06:00
if [ ! -f "./client/dist/en-US/index.html" ]; then
2020-02-19 02:14:28 -06:00
if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then
echo "client/dist/en-US/index.html does not exist, compile client files..."
2022-01-03 09:37:16 -06:00
npm run build:client
2020-02-19 02:14:28 -06:00
fi
2017-06-11 04:29:03 -05:00
fi
2019-12-17 08:33:58 -06:00
# Copy locales
mkdir -p "./client/dist"
rm -rf "./client/dist/locale"
cp -r "./client/src/locale" "./client/dist/locale"
mkdir -p "./dist/server/lib"
2019-12-17 08:33:58 -06:00
2021-12-14 06:48:13 -06:00
npm run tsc -- -b -v --incremental
npm run resolve-tspaths:server
2019-12-17 08:33:58 -06:00
cp -r ./server/static ./server/assets ./dist/server
2020-07-28 02:57:16 -05:00
cp -r "./server/lib/emails" "./dist/server/lib"
2019-12-17 08:33:58 -06:00
./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=test node dist/server"'