jenkins-bot has submitted this change and it was merged.

Change subject: updateCredits: Do not change working directory
......................................................................


updateCredits: Do not change working directory

This allows the script to be used by MediaWiki extensions.
Example in UploadWizard: I181dda3ca3ef3f43e863482057b4949c1bc32e9b.

Change-Id: Ib121c6e226bdc1b3a8976c96b8d9f21546a1b5d3
---
M maintenance/updateCredits.php
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/updateCredits.php b/maintenance/updateCredits.php
index a43e0ba..eb717e8 100644
--- a/maintenance/updateCredits.php
+++ b/maintenance/updateCredits.php
@@ -26,8 +26,6 @@
        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 @@
 $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 ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/322658
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib121c6e226bdc1b3a8976c96b8d9f21546a1b5d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to