X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=scripts%2Fdev%2Fserver.sh;h=680ca3d7915bf608c8c1730701e826575b8612af;hb=4c1def5fd8e9f483238eb38e221f555e2e6bbf07;hp=3130f1d87254ad9c374b2bb9b14b53ffef0a5958;hpb=18c8e945089bff49d2c617c411c8a8f4575989ad;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index 3130f1d87..680ca3d79 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh @@ -1,8 +1,27 @@ -#!/usr/bin/env sh +#!/bin/bash -if [ ! -f "./client/dist/index.html" ]; then - echo "client/dist/index.html does not exist, compile client files..." - npm run build:client +set -eu + +if [ ! -f "./client/dist/en-US/index.html" ]; then + if [ -z ${1+x} ] || [ "$1" != "--skip-client" ]; then + echo "client/dist/en-US/index.html does not exist, compile client files..." + npm run build:client -- --light + fi fi -npm run watch:server +# Copy locales +mkdir -p "./client/dist" +rm -rf "./client/dist/locale" +cp -r "./client/src/locale" "./client/dist/locale" + +rm -rf "./dist" + +mkdir "./dist" +cp "./tsconfig.json" "./dist" + +npm run tsc -- --incremental --sourceMap +cp -r ./server/static ./server/assets ./dist/server + +NODE_ENV=test node node_modules/.bin/concurrently -k \ + "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \ + "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w"