From a93ae2ffed060e932c0fa4cf8f6ea93fdf0820f7 Mon Sep 17 00:00:00 2001 From: jubnl Date: Wed, 6 May 2026 15:18:28 +0200 Subject: [PATCH] chore: add build-from-sources script --- build-from-sources | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 build-from-sources diff --git a/build-from-sources b/build-from-sources new file mode 100755 index 00000000..44baf80c --- /dev/null +++ b/build-from-sources @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")" && pwd)" +CLIENT_DIR="$REPO_ROOT/client" +SERVER_DIR="$REPO_ROOT/server" +PUBLIC_DIR="$REPO_ROOT/server/public" + +echo "==> Installing client dependencies" +cd "$CLIENT_DIR" +npm ci + +echo "==> Building client" +npm run build + +echo "==> Installing server dependencies" +cd "$SERVER_DIR" +npm ci + +echo "==> Populating server/public" +find "$PUBLIC_DIR" -mindepth 1 ! -name '.gitkeep' -delete +cp -r "$CLIENT_DIR/dist/." "$PUBLIC_DIR/" +cp -r "$CLIENT_DIR/public/fonts" "$PUBLIC_DIR/fonts" + +echo "==> Done — server/public is ready"