with correct drush and delete old comparison files
This commit is contained in:
parent
d5c8076e2f
commit
e761ae7dc0
2 changed files with 19 additions and 4 deletions
|
|
@ -105,6 +105,21 @@ function exportAllTables($connection, $outputDir) {
|
||||||
mkdir($outputDir, 0755, TRUE);
|
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);
|
$tables = getWisskiTables($connection);
|
||||||
$allData = [
|
$allData = [
|
||||||
'export_timestamp' => date('Y-m-d H:i:s'),
|
'export_timestamp' => date('Y-m-d H:i:s'),
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,12 @@ echo "Step 2: Running Drupal updates..."
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
|
|
||||||
# Check if drush is available.
|
# Check if drush is available.
|
||||||
if command -v drush &> /dev/null; then
|
if command -v ./vendor/bin/drush &> /dev/null; then
|
||||||
echo "Running: drush updatedb -y"
|
echo "Running: ./vendor/bin/drush updatedb -y"
|
||||||
drush updatedb -y
|
./vendor/bin/drush updatedb -y
|
||||||
else
|
else
|
||||||
echo "Drush not found. Please run Drupal updates manually:"
|
echo "Drush not found. Please run Drupal updates manually:"
|
||||||
echo " drush updatedb -y"
|
echo " ./vendor/bin/drush updatedb -y"
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Press Enter after you have run the updates, or Ctrl+C to cancel..."
|
read -p "Press Enter after you have run the updates, or Ctrl+C to cancel..."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue