From e761ae7dc00e6466b7fc5d19968b36e227bd990f Mon Sep 17 00:00:00 2001 From: Robert Nasarek Date: Tue, 9 Dec 2025 10:49:31 +0100 Subject: [PATCH] with correct drush and delete old comparison files --- test-wisski-data-integrity.php | 15 +++++++++++++++ test-wisski-update.sh | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test-wisski-data-integrity.php b/test-wisski-data-integrity.php index bc1504b..b70b45d 100644 --- a/test-wisski-data-integrity.php +++ b/test-wisski-data-integrity.php @@ -105,6 +105,21 @@ function exportAllTables($connection, $outputDir) { mkdir($outputDir, 0755, TRUE); } + // Delete old JSON files before exporting new data. + if (is_dir($outputDir)) { + $files = glob($outputDir . '/*.json'); + $deletedCount = 0; + foreach ($files as $file) { + if (is_file($file)) { + unlink($file); + $deletedCount++; + } + } + if ($deletedCount > 0) { + echo "Deleted {$deletedCount} old JSON file(s) from previous export.\n"; + } + } + $tables = getWisskiTables($connection); $allData = [ 'export_timestamp' => date('Y-m-d H:i:s'), diff --git a/test-wisski-update.sh b/test-wisski-update.sh index 885d0bc..50330e9 100755 --- a/test-wisski-update.sh +++ b/test-wisski-update.sh @@ -37,12 +37,12 @@ echo "Step 2: Running Drupal updates..." echo "----------------------------------------" # Check if drush is available. -if command -v drush &> /dev/null; then - echo "Running: drush updatedb -y" - drush updatedb -y +if command -v ./vendor/bin/drush &> /dev/null; then + echo "Running: ./vendor/bin/drush updatedb -y" + ./vendor/bin/drush updatedb -y else echo "Drush not found. Please run Drupal updates manually:" - echo " drush updatedb -y" + echo " ./vendor/bin/drush updatedb -y" echo "" read -p "Press Enter after you have run the updates, or Ctrl+C to cancel..." fi