From 129a7597951cee913255f96fbb5fb167442abe69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Tue, 28 Oct 2025 23:24:36 +0100 Subject: [PATCH] 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. --- arty.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/arty.yml b/arty.yml index 5b25a21..bf2e983 100644 --- a/arty.yml +++ b/arty.yml @@ -133,21 +133,16 @@ scripts: # Step 2: Apply schema (updates Directus metadata) sexy/import/all: | 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..." && - docker exec -i core_postgres psql -U ${DB_USER} -d ${SEXY_DB_NAME} < ~/Projects/docker-compose/sexy/directus.sql && - echo "✓ Database imported" && - echo "Applying Directus schema..." && - docker cp ~/Projects/docker-compose/sexy/schema.yaml sexy_api:/directus/schema.yaml && - docker exec sexy_api npx directus schema apply --yes /directus/schema.yaml && - echo "✓ Schema applied" && - echo "Restarting Directus API..." && - docker restart sexy_api && - echo "✓✓✓ Complete import finished successfully!"; - else - echo "Import cancelled."; - fi + echo "Importing database..." && + docker exec -i core_postgres psql -U ${DB_USER} -d ${SEXY_DB_NAME} < ~/Projects/docker-compose/sexy/directus.sql && + echo "✓ Database imported" && + echo "Applying Directus schema..." && + docker cp ~/Projects/docker-compose/sexy/schema.yaml sexy_api:/directus/schema.yaml && + docker exec sexy_api npx directus schema apply --yes /directus/schema.yaml && + echo "✓ Schema applied" && + echo "Restarting Directus API..." && + docker restart sexy_api && + echo "✓✓✓ Complete import finished successfully!" sexy/uploads/export: | rm -rf sexy/uploads