fix: configure .env even when .env.example doesn't exist

Release zip contains .env directly, not .env.example. The sed commands
to update database credentials were being skipped because the file check
looked for .env.example first, which doesn't exist in published releases.
This commit is contained in:
Ollama
2026-05-15 10:04:42 +02:00
parent 65fdea0807
commit e98bf38af6

View File

@@ -160,6 +160,9 @@ fi
echo -e "${COLOR_GREEN}[7/9] Configuring OSPOS...${COLOR_RESET}"
if [ -f ".env.example" ]; then
cp .env.example .env
fi
if [ -f ".env" ]; then
sed -i "s/database\.default\.hostname = localhost/database.default.hostname = ${DB_HOST}/" .env
sed -i "s/database\.default\.database = ospos/database.default.database = ${DB_NAME}/" .env
sed -i "s/database\.default\.username = admin/database.default.username = ${DB_USER}/" .env