Files
Erik Michelson af0365d9ad fix(docker): remove bash-dependencies from build script
The build script for the backend relied on some bash specifics.
Since bash is not available in alpine based node docker images,
building failed. This commit replaces bash functions with the
native POSIX equivalents.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2026-01-12 09:46:41 +01:00

29 lines
640 B
Bash
Executable File

#!/bin/sh
#
# SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
#
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR" || exit 1
if [ -d "dist" ]; then
echo "🦔 > Clearing dist directory"
rm -rf dist
fi
echo "🦔 > Building NestJS application"
nest build
if [ -d "dist/src/database/migrations" ]; then
echo "🦔 > Removing TypeScript definitions from migrations folder"
rm -f dist/src/database/migrations/*.d.ts 2>/dev/null || true
rm -f dist/src/database/migrations/*.map 2>/dev/null || true
fi
echo "🦔 > Done building backend"
exit 0