diff --git a/src/Console/CreateCommand.php b/src/Console/CreateCommand.php index 68bff0f..039c380 100644 --- a/src/Console/CreateCommand.php +++ b/src/Console/CreateCommand.php @@ -7,6 +7,7 @@ use Studio\Config\Config; use Studio\Creator\CreatorInterface; use Studio\Creator\GitRepoCreator; +use Studio\Creator\GitSubmoduleCreator; use Studio\Creator\SkeletonCreator; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -57,6 +58,12 @@ protected function configure() 'g', InputOption::VALUE_REQUIRED, 'If set, this will download the given Git repository instead of creating a new one.' + ) + ->addOption( + 'submodule', + 'gs', + InputOption::VALUE_REQUIRED, + 'If set, this will download the given Git repository (as submodule) instead of creating a new one.' ); } @@ -92,6 +99,8 @@ protected function makeCreator(InputInterface $input) if ($input->getOption('git')) { return new GitRepoCreator($input->getOption('git'), $path); + } elseif ($input->getOption('submodule')) { + return new GitSubmoduleCreator($input->getOption('submodule'), $path); } else { $creator = new SkeletonCreator($path); $this->installParts($creator); diff --git a/src/Creator/GitSubmoduleCreator.php b/src/Creator/GitSubmoduleCreator.php new file mode 100644 index 0000000..a0a4c85 --- /dev/null +++ b/src/Creator/GitSubmoduleCreator.php @@ -0,0 +1,16 @@ +repo $this->path"); + Shell::run("git submodule init"); + } + +}