1 Commits

Author SHA1 Message Date
7c98a6ceaf Merge pull request 'Beta-2.1 - The clearer, the faster' (#22) from Beta-2.1 into main
Reviewed-on: #22
2025-09-04 12:50:26 +02:00

View File

@ -6,26 +6,27 @@ NC="\033[0m"
copy_default_config() {
echo "[~] Checking configuration directory..."
if [ ! -d "/app/config" ]; then
mkdir -p /app/config
fi
echo "[~] Checking if default config files/folders need to be copied..."
files_copied=false
for src in $(find /app/default -mindepth 1); do
# Recursively check all files and folders in /app/default
while IFS= read -r src; do
relpath="${src#/app/default/}"
target="/app/config/$relpath"
if [ ! -e "$target" ]; then
echo "[→] Copying: $relpath"
if [ -d "$src" ]; then
mkdir -p "$target"
cp -r "$src/" "$target/"
cp -r "$src" "$target"
else
mkdir -p "$(dirname "$target")"
cp "$src" "$target"
fi
files_copied=true
fi
done
done < <(find /app/default -mindepth 1)
if [ "$files_copied" = true ]; then
echo "[✓] Default configuration files/folders copied successfully."