@@ -41,55 +41,55 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | parent::configure(); |
| 43 | 43 | $this->setName('install') |
| 44 | - ->setDescription('Install git hooks') |
|
| 45 | - ->setHelp('This command will install the git hooks to your .git directory') |
|
| 46 | - ->addArgument( |
|
| 47 | - 'hook', |
|
| 48 | - InputArgument::OPTIONAL, |
|
| 49 | - 'Limit the hook you want to install. By default all hooks get installed.' |
|
| 50 | - ) |
|
| 51 | - ->addOption( |
|
| 52 | - 'force', |
|
| 53 | - 'f', |
|
| 54 | - InputOption::VALUE_NONE, |
|
| 55 | - 'Force install without confirmation' |
|
| 56 | - ) |
|
| 57 | - ->addOption( |
|
| 58 | - 'skip-existing', |
|
| 59 | - 's', |
|
| 60 | - InputOption::VALUE_NONE, |
|
| 61 | - 'Do not overwrite existing hooks' |
|
| 62 | - ) |
|
| 63 | - ->addOption( |
|
| 64 | - 'move-existing-to', |
|
| 65 | - null, |
|
| 66 | - InputOption::VALUE_OPTIONAL, |
|
| 67 | - 'Move existing hooks to given directory' |
|
| 68 | - ) |
|
| 69 | - ->addOption( |
|
| 70 | - 'bootstrap', |
|
| 71 | - 'b', |
|
| 72 | - InputOption::VALUE_OPTIONAL, |
|
| 73 | - 'Path to composers vendor/autoload.php' |
|
| 74 | - ) |
|
| 75 | - ->addOption( |
|
| 76 | - 'run-mode', |
|
| 77 | - 'm', |
|
| 78 | - InputOption::VALUE_OPTIONAL, |
|
| 79 | - 'Git hook run mode [php|shell|docker]' |
|
| 80 | - ) |
|
| 81 | - ->addOption( |
|
| 82 | - 'run-exec', |
|
| 83 | - 'e', |
|
| 84 | - InputOption::VALUE_OPTIONAL, |
|
| 85 | - 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
| 86 | - ) |
|
| 87 | - ->addOption( |
|
| 88 | - 'run-path', |
|
| 89 | - 'p', |
|
| 90 | - InputOption::VALUE_OPTIONAL, |
|
| 91 | - 'The path to the CaptainHook executable \'/usr/bin/captainhook\'' |
|
| 92 | - ); |
|
| 44 | + ->setDescription('Install git hooks') |
|
| 45 | + ->setHelp('This command will install the git hooks to your .git directory') |
|
| 46 | + ->addArgument( |
|
| 47 | + 'hook', |
|
| 48 | + InputArgument::OPTIONAL, |
|
| 49 | + 'Limit the hook you want to install. By default all hooks get installed.' |
|
| 50 | + ) |
|
| 51 | + ->addOption( |
|
| 52 | + 'force', |
|
| 53 | + 'f', |
|
| 54 | + InputOption::VALUE_NONE, |
|
| 55 | + 'Force install without confirmation' |
|
| 56 | + ) |
|
| 57 | + ->addOption( |
|
| 58 | + 'skip-existing', |
|
| 59 | + 's', |
|
| 60 | + InputOption::VALUE_NONE, |
|
| 61 | + 'Do not overwrite existing hooks' |
|
| 62 | + ) |
|
| 63 | + ->addOption( |
|
| 64 | + 'move-existing-to', |
|
| 65 | + null, |
|
| 66 | + InputOption::VALUE_OPTIONAL, |
|
| 67 | + 'Move existing hooks to given directory' |
|
| 68 | + ) |
|
| 69 | + ->addOption( |
|
| 70 | + 'bootstrap', |
|
| 71 | + 'b', |
|
| 72 | + InputOption::VALUE_OPTIONAL, |
|
| 73 | + 'Path to composers vendor/autoload.php' |
|
| 74 | + ) |
|
| 75 | + ->addOption( |
|
| 76 | + 'run-mode', |
|
| 77 | + 'm', |
|
| 78 | + InputOption::VALUE_OPTIONAL, |
|
| 79 | + 'Git hook run mode [php|shell|docker]' |
|
| 80 | + ) |
|
| 81 | + ->addOption( |
|
| 82 | + 'run-exec', |
|
| 83 | + 'e', |
|
| 84 | + InputOption::VALUE_OPTIONAL, |
|
| 85 | + 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
| 86 | + ) |
|
| 87 | + ->addOption( |
|
| 88 | + 'run-path', |
|
| 89 | + 'p', |
|
| 90 | + InputOption::VALUE_OPTIONAL, |
|
| 91 | + 'The path to the CaptainHook executable \'/usr/bin/captainhook\'' |
|
| 92 | + ); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | $template = Template\Builder::build($config, $repo, $this->resolver); |
| 116 | 116 | $installer = new Installer($io, $config, $repo, $template); |
| 117 | 117 | $installer->setForce(IOUtil::argToBool($input->getOption('force'))) |
| 118 | - ->setSkipExisting(IOUtil::argToBool($input->getOption('skip-existing'))) |
|
| 119 | - ->setMoveExistingTo(IOUtil::argToString($input->getOption('move-existing-to'))) |
|
| 120 | - ->setHook(IOUtil::argToString($input->getArgument('hook'))) |
|
| 121 | - ->run(); |
|
| 118 | + ->setSkipExisting(IOUtil::argToBool($input->getOption('skip-existing'))) |
|
| 119 | + ->setMoveExistingTo(IOUtil::argToString($input->getOption('move-existing-to'))) |
|
| 120 | + ->setHook(IOUtil::argToString($input->getArgument('hook'))) |
|
| 121 | + ->run(); |
|
| 122 | 122 | |
| 123 | 123 | return 0; |
| 124 | 124 | } |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | // callback to write bool true to all array entries |
| 176 | 176 | // to make sure the user will be asked to confirm every hook installation |
| 177 | 177 | // unless the user provided the force or skip option |
| 178 | - $callback = function () { |
|
| 178 | + $callback = function() { |
|
| 179 | 179 | return true; |
| 180 | 180 | }; |
| 181 | 181 | // if a specific hook is set the user chose it so don't ask for permission anymore |