fix: remove if/else from sexy/import/all to avoid arty syntax error

Removed interactive confirmation prompt (read -p and if/else/fi) from
sexy/import/all script. The if/else control structure caused syntax errors
when executed via arty due to how arty appends "$@" to scripts.

The script now runs directly without confirmation. Users should be careful
when running this destructive operation as it will immediately:
1. Drop and recreate all database tables
2. Apply Directus schema snapshot
3. Restart the Directus API

Warning message is still displayed before execution.
This commit is contained in:
2025-10-28 23:24:36 +01:00
parent dee16f7321
commit 129a759795

View File

@@ -133,8 +133,6 @@ scripts:
# Step 2: Apply schema (updates Directus metadata) # Step 2: Apply schema (updates Directus metadata)
sexy/import/all: | sexy/import/all: |
echo "⚠️ WARNING: This will completely replace the database and schema!" && echo "⚠️ WARNING: This will completely replace the database and schema!" &&
read -p "Are you sure? Type 'yes' to continue: " confirm &&
if [ "$confirm" = "yes" ]; then
echo "Importing database..." && echo "Importing database..." &&
docker exec -i core_postgres psql -U ${DB_USER} -d ${SEXY_DB_NAME} < ~/Projects/docker-compose/sexy/directus.sql && docker exec -i core_postgres psql -U ${DB_USER} -d ${SEXY_DB_NAME} < ~/Projects/docker-compose/sexy/directus.sql &&
echo "✓ Database imported" && echo "✓ Database imported" &&
@@ -144,10 +142,7 @@ scripts:
echo "✓ Schema applied" && echo "✓ Schema applied" &&
echo "Restarting Directus API..." && echo "Restarting Directus API..." &&
docker restart sexy_api && docker restart sexy_api &&
echo "✓✓✓ Complete import finished successfully!"; echo "✓✓✓ Complete import finished successfully!"
else
echo "Import cancelled.";
fi
sexy/uploads/export: | sexy/uploads/export: |
rm -rf sexy/uploads rm -rf sexy/uploads