@@ -20,6 +20,8 @@ use Symfony\Component\Filesystem\Filesystem;
*/
classConverter{
privateconstRUN_CHECKS=TRUE;
/**
* Prints message.
*
...
...
@@ -38,18 +40,20 @@ class Converter {
*/
publicstaticfunctiondoConvert(Event$event):void{
$args=$event->getArguments();
if(count($args)!==2){
thrownew\Exception("This scripts 2 arguments, a directory that is a core clone and the branch.");
$count_arg=count($args);
if(!($count_arg===2||$count_arg===3)){
thrownew\Exception("This scripts 2 required arguments: a directory that is a core clone and the branch.\nIt has 1 optional arguments: the branch of this module to use which defaults to 3.0.x");
}
$core_dir=$args[0];
$core_branch=$args[1];
if(!is_dir($core_dir)){
thrownew\Exception("$core_dir is not a directory.");