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>
This commit is contained in:
Erik Michelson
2026-01-11 23:47:55 +01:00
committed by Philip Molares
parent 4b8b36ab76
commit af0365d9ad
+7 -6
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
#!/bin/sh
#
# SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
#
set -euo pipefail
set -eu
_script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd "${_script_dir}" || exit 1
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR" || exit 1
if [ -d "dist" ]; then
echo "🦔 > Clearing dist directory"
@@ -19,9 +19,10 @@ nest build
if [ -d "dist/src/database/migrations" ]; then
echo "🦔 > Removing TypeScript definitions from migrations folder"
rm -rf dist/src/database/migrations/*.d.ts 2>/dev/null || true
rm -rf dist/src/database/migrations/*.map 2>/dev/null || true
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