Previously, `manageForeignResources.php update foo` would output
"Done!", which is very similar to "... updating foo\nDone!".
The module argument is now validated, just like how the
action argument was validated already.
Change-Id: Ia7c87de5d86b9d1a411485cac43b1529fe88a59f
file_get_contents( __DIR__ . '/foreign-resources.yaml' )
);
$module = $this->getArg( 1, 'all' );
- foreach ( $registry as $moduleName => $info ) {
- if ( $module !== 'all' && $moduleName !== $module ) {
- continue;
- }
+ if ( $module === 'all' ) {
+ $modules = $registry;
+ } elseif ( isset( $registry[ $module ] ) ) {
+ $modules = [ $module => $registry[ $module ] ];
+ } else {
+ $this->fatalError( 'Unknown module name.' );
+ }
+
+ foreach ( $modules as $moduleName => $info ) {
$this->verbose( "\n### {$moduleName}\n\n" );
$destDir = "{$IP}/resources/lib/$moduleName";