X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateCredits.php;h=287a40c558ee55d8415f43e9dae45dcc9683e660;hb=ab031c41ec5b930a9897f57a755a2874c1c643bc;hp=a43e0ba3f0439d8cc0d4430724e4dea8072a7775;hpb=86448ece43db70f21d591b7d0ce52447664a2600;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateCredits.php b/maintenance/updateCredits.php index a43e0ba3f0..287a40c558 100644 --- a/maintenance/updateCredits.php +++ b/maintenance/updateCredits.php @@ -26,8 +26,6 @@ if ( PHP_SAPI != 'cli' ) { die( "This script can only be run from the command line.\n" ); } -chdir( dirname( __DIR__ ) ); - $CREDITS = 'CREDITS'; $START_CONTRIBUTORS = ''; $END_CONTRIBUTORS = ''; @@ -38,6 +36,10 @@ $header = []; $contributors = []; $footer = []; +if ( !file_exists( $CREDITS ) ) { + exit( 'No CREDITS file found. Are you running this script in the right directory?' ); +} + $lines = explode( "\n", file_get_contents( $CREDITS ) ); foreach ( $lines as $line ) { if ( $inHeader ) { @@ -57,7 +59,7 @@ unset( $lines ); $lines = explode( "\n", shell_exec( 'git log --format="%aN"' ) ); foreach ( $lines as $line ) { - if ( empty( $line ) ) { + if ( empty( $line ) ) { continue; } if ( substr( $line, 0, 5 ) === '[BOT]' ) {