Merge "Added release notes for 'ContentHandler::runLegacyHooks' removal"
[lhc/web/wiklou.git] / maintenance / updateCredits.php
index a43e0ba..eb717e8 100644 (file)
@@ -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 = '<!-- BEGIN CONTRIBUTOR LIST -->';
 $END_CONTRIBUTORS = '<!-- END CONTRIBUTOR LIST -->';
@@ -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 ) {