chore: print server logs in git-pull.php

This commit is contained in:
2026-09-18 10:03:16 +08:00
parent c84babc076
commit ec09402897
2 changed files with 22 additions and 0 deletions

View File

@@ -58,6 +58,16 @@ if (is_dir($targetDir . '/.git')) {
echo "Warning: .git directory not found in path hierarchy. Falling back to script directory: " . getcwd() . "\n\n";
}
echo "Last 30 lines of storage/logs/laravel.log:\n";
$logFile = getcwd() . '/storage/logs/laravel.log';
if (file_exists($logFile)) {
$lines = file($logFile);
echo implode('', array_slice($lines, -30));
} else {
echo "No log file found.\n";
}
echo "\n-----------------------------------------\n\n";
// Helper function to execute commands with proc_open or standard fallbacks
function execute($cmd) {