From 48662e9b1724c9ed041164dd970bb112e88d03e9 Mon Sep 17 00:00:00 2001 From: "Johannes M. Schmitt" Date: Sat, 21 Jul 2012 18:50:41 +0200 Subject: [PATCH] added no-scripts option --- src/Composer/Command/CreateProjectCommand.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index eb6c2b396..e7a0a19bc 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -48,7 +48,8 @@ class CreateProjectCommand extends Command new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'), new InputOption('repository-url', null, InputOption::VALUE_REQUIRED, 'Pick a different repository url to look for the package.'), new InputOption('dev', null, InputOption::VALUE_NONE, 'Whether to install dependencies for development.'), - new InputOption('disable-custom-installers', null, InputOption::VALUE_NONE, 'Whether to disable custom installers.'), + new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Whether to disable custom installers.'), + new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Whether to prevent execution of all defined scripts in the root package.') )) ->setHelp(<<create-project command creates a new project from a given @@ -81,11 +82,12 @@ EOT $input->getOption('prefer-source'), $input->getOption('dev'), $input->getOption('repository-url'), - $input->getOption('disable-custom-installers') + $input->getOption('no-custom-installers'), + $input->getOption('no-scripts') ); } - public function installProject(IOInterface $io, $packageName, $directory = null, $version = null, $preferSource = false, $installDevPackages = false, $repositoryUrl = null, $disableCustomInstallers = false) + public function installProject(IOInterface $io, $packageName, $directory = null, $version = null, $preferSource = false, $installDevPackages = false, $repositoryUrl = null, $disableCustomInstallers = false, $noScripts = false) { $dm = $this->createDownloadManager($io); if ($preferSource) { @@ -146,7 +148,8 @@ EOT $installer = Installer::create($io, $composer); $installer->setPreferSource($preferSource) - ->setDevMode($installDevPackages); + ->setDevMode($installDevPackages) + ->setRunScripts( ! $noScripts); if ($disableCustomInstallers) { $installer->disableCustomInstallers();