diff --git a/maintenance/generateExtensionDatabaseList.php b/maintenance/generateExtensionDatabaseList.php index 87fbd4d07..178d049d5 100644 --- a/maintenance/generateExtensionDatabaseList.php +++ b/maintenance/generateExtensionDatabaseList.php @@ -13,6 +13,7 @@ public function __construct() { $desc = 'Extension or skin to generate database list for. ' . 'This option may be passed multiple times to generate multiple database lists at once.'; + $this->addOption( 'directory', 'Directory to store the json file in.', true, true ); $this->addOption( 'extension', $desc, true, true, false, true ); } @@ -39,9 +40,9 @@ public function execute() { } } - $shellUser = posix_getpwuid( posix_geteuid() )['name']; + $directory = $this->getOption( 'directory' ); foreach ( $extArray as $ext ) { - file_put_contents( "/home/{$shellUser}/{$ext}.json", json_encode( [ 'combi' => $lists[$ext] ] ), LOCK_EX ); + file_put_contents( "{$directory}/{$ext}.json", json_encode( [ 'combi' => $lists[$ext] ] ), LOCK_EX ); } } }