diff -r 1a3fa80225b2 -r 5a0cbbe0922a authserver/homestead/src/InitCommand.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/authserver/homestead/src/InitCommand.php Wed May 27 15:34:06 2015 +0200 @@ -0,0 +1,45 @@ +setName('init') + ->setDescription('Create a stub Homestead.yaml file'); + } + + /** + * Execute the command. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @return void + */ + public function execute(InputInterface $input, OutputInterface $output) + { + if (is_dir(homestead_path())) + { + throw new \InvalidArgumentException("Homestead has already been initialized."); + } + + mkdir(homestead_path()); + + copy(__DIR__.'/stubs/Homestead.yaml', homestead_path().'/Homestead.yaml'); + copy(__DIR__.'/stubs/after.sh', homestead_path().'/after.sh'); + copy(__DIR__.'/stubs/aliases', homestead_path().'/aliases'); + + $output->writeln('Creating Homestead.yaml file... '); + $output->writeln('Homestead.yaml file created at: '.homestead_path().'/Homestead.yaml'); + } + +}