@@ -166,7 +166,7 @@ |
||
| 166 | 166 | $repo = new Repository($fakeRepo->getRoot()); |
| 167 | 167 | |
| 168 | 168 | $config->method('isHookEnabled')->willReturnCallback( |
| 169 | - function (string $hook): bool { |
|
| 169 | + function(string $hook): bool { |
|
| 170 | 170 | return $hook === 'pre-push'; |
| 171 | 171 | } |
| 172 | 172 | ); |
@@ -228,7 +228,7 @@ |
||
| 228 | 228 | // if hook is configured and no force option is set |
| 229 | 229 | // ask the user if overwriting the hook is ok |
| 230 | 230 | if ($this->needConfirmation($hook)) { |
| 231 | - $ans = $this->io->ask( |
|
| 231 | + $ans = $this->io->ask( |
|
| 232 | 232 | 'The <comment>' . $hook . '</comment> hook exists! Overwrite? <comment>[y,N]</comment> ', |
| 233 | 233 | 'n' |
| 234 | 234 | ); |
@@ -41,64 +41,64 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | parent::configure(); |
| 43 | 43 | $this->setName('install') |
| 44 | - ->setDescription('Install hooks to your .git/hooks directory') |
|
| 45 | - ->setHelp('Install git hooks to your .git/hooks directory') |
|
| 46 | - ->addArgument( |
|
| 47 | - 'hook', |
|
| 48 | - InputArgument::OPTIONAL, |
|
| 49 | - 'Limit the hooks you want to install. ' . |
|
| 50 | - 'You can specify multiple hooks with comma as delimiter. ' . |
|
| 51 | - 'By default all hooks get installed' |
|
| 52 | - ) |
|
| 53 | - ->addOption( |
|
| 54 | - 'only-enabled', |
|
| 55 | - null, |
|
| 56 | - InputOption::VALUE_NONE, |
|
| 57 | - 'Limit the hooks you want to install to those enabled in your conf. ' . |
|
| 58 | - 'By default all hooks get installed' |
|
| 59 | - ) |
|
| 60 | - ->addOption( |
|
| 61 | - 'force', |
|
| 62 | - 'f', |
|
| 63 | - InputOption::VALUE_NONE, |
|
| 64 | - 'Force install without confirmation' |
|
| 65 | - ) |
|
| 66 | - ->addOption( |
|
| 67 | - 'skip-existing', |
|
| 68 | - 's', |
|
| 69 | - InputOption::VALUE_NONE, |
|
| 70 | - 'Do not overwrite existing hooks' |
|
| 71 | - ) |
|
| 72 | - ->addOption( |
|
| 73 | - 'move-existing-to', |
|
| 74 | - null, |
|
| 75 | - InputOption::VALUE_OPTIONAL, |
|
| 76 | - 'Move existing hooks to given directory' |
|
| 77 | - ) |
|
| 78 | - ->addOption( |
|
| 79 | - 'bootstrap', |
|
| 80 | - 'b', |
|
| 81 | - InputOption::VALUE_OPTIONAL, |
|
| 82 | - 'Path to composers vendor/autoload.php' |
|
| 83 | - ) |
|
| 84 | - ->addOption( |
|
| 85 | - 'run-mode', |
|
| 86 | - 'm', |
|
| 87 | - InputOption::VALUE_OPTIONAL, |
|
| 88 | - 'Git hook run mode [php|shell|docker]' |
|
| 89 | - ) |
|
| 90 | - ->addOption( |
|
| 91 | - 'run-exec', |
|
| 92 | - 'e', |
|
| 93 | - InputOption::VALUE_OPTIONAL, |
|
| 94 | - 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
| 95 | - ) |
|
| 96 | - ->addOption( |
|
| 97 | - 'run-path', |
|
| 98 | - 'p', |
|
| 99 | - InputOption::VALUE_OPTIONAL, |
|
| 100 | - 'The path to the CaptainHook executable \'/usr/bin/captainhook\'' |
|
| 101 | - ); |
|
| 44 | + ->setDescription('Install hooks to your .git/hooks directory') |
|
| 45 | + ->setHelp('Install git hooks to your .git/hooks directory') |
|
| 46 | + ->addArgument( |
|
| 47 | + 'hook', |
|
| 48 | + InputArgument::OPTIONAL, |
|
| 49 | + 'Limit the hooks you want to install. ' . |
|
| 50 | + 'You can specify multiple hooks with comma as delimiter. ' . |
|
| 51 | + 'By default all hooks get installed' |
|
| 52 | + ) |
|
| 53 | + ->addOption( |
|
| 54 | + 'only-enabled', |
|
| 55 | + null, |
|
| 56 | + InputOption::VALUE_NONE, |
|
| 57 | + 'Limit the hooks you want to install to those enabled in your conf. ' . |
|
| 58 | + 'By default all hooks get installed' |
|
| 59 | + ) |
|
| 60 | + ->addOption( |
|
| 61 | + 'force', |
|
| 62 | + 'f', |
|
| 63 | + InputOption::VALUE_NONE, |
|
| 64 | + 'Force install without confirmation' |
|
| 65 | + ) |
|
| 66 | + ->addOption( |
|
| 67 | + 'skip-existing', |
|
| 68 | + 's', |
|
| 69 | + InputOption::VALUE_NONE, |
|
| 70 | + 'Do not overwrite existing hooks' |
|
| 71 | + ) |
|
| 72 | + ->addOption( |
|
| 73 | + 'move-existing-to', |
|
| 74 | + null, |
|
| 75 | + InputOption::VALUE_OPTIONAL, |
|
| 76 | + 'Move existing hooks to given directory' |
|
| 77 | + ) |
|
| 78 | + ->addOption( |
|
| 79 | + 'bootstrap', |
|
| 80 | + 'b', |
|
| 81 | + InputOption::VALUE_OPTIONAL, |
|
| 82 | + 'Path to composers vendor/autoload.php' |
|
| 83 | + ) |
|
| 84 | + ->addOption( |
|
| 85 | + 'run-mode', |
|
| 86 | + 'm', |
|
| 87 | + InputOption::VALUE_OPTIONAL, |
|
| 88 | + 'Git hook run mode [php|shell|docker]' |
|
| 89 | + ) |
|
| 90 | + ->addOption( |
|
| 91 | + 'run-exec', |
|
| 92 | + 'e', |
|
| 93 | + InputOption::VALUE_OPTIONAL, |
|
| 94 | + 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
| 95 | + ) |
|
| 96 | + ->addOption( |
|
| 97 | + 'run-path', |
|
| 98 | + 'p', |
|
| 99 | + InputOption::VALUE_OPTIONAL, |
|
| 100 | + 'The path to the CaptainHook executable \'/usr/bin/captainhook\'' |
|
| 101 | + ); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | $template = Template\Builder::build($config, $repo, $this->resolver); |
| 131 | 131 | $installer = new Installer($io, $config, $repo, $template); |
| 132 | 132 | $installer->setHook(IOUtil::argToString($input->getArgument('hook'))) |
| 133 | - ->setForce(IOUtil::argToBool($input->getOption('force'))) |
|
| 134 | - ->setSkipExisting(IOUtil::argToBool($input->getOption('skip-existing'))) |
|
| 135 | - ->setMoveExistingTo(IOUtil::argToString($input->getOption('move-existing-to'))) |
|
| 136 | - ->setOnlyEnabled(IOUtil::argToBool($input->getOption('only-enabled'))) |
|
| 137 | - ->run(); |
|
| 133 | + ->setForce(IOUtil::argToBool($input->getOption('force'))) |
|
| 134 | + ->setSkipExisting(IOUtil::argToBool($input->getOption('skip-existing'))) |
|
| 135 | + ->setMoveExistingTo(IOUtil::argToString($input->getOption('move-existing-to'))) |
|
| 136 | + ->setOnlyEnabled(IOUtil::argToBool($input->getOption('only-enabled'))) |
|
| 137 | + ->run(); |
|
| 138 | 138 | |
| 139 | 139 | return 0; |
| 140 | 140 | } |
@@ -37,32 +37,32 @@ |
||
| 37 | 37 | { |
| 38 | 38 | parent::configure(); |
| 39 | 39 | $this->setName('uninstall') |
| 40 | - ->setDescription('Remove all git hooks from your .git/hooks directory') |
|
| 41 | - ->setHelp('Remove all git hooks from your .git/hooks directory') |
|
| 42 | - ->addArgument( |
|
| 43 | - 'hook', |
|
| 44 | - InputArgument::OPTIONAL, |
|
| 45 | - 'Remove only this one hook. By default all hooks get uninstalled' |
|
| 46 | - ) |
|
| 47 | - ->addOption( |
|
| 48 | - 'force', |
|
| 49 | - 'f', |
|
| 50 | - InputOption::VALUE_NONE, |
|
| 51 | - 'Force install without confirmation' |
|
| 52 | - ) |
|
| 53 | - ->addOption( |
|
| 54 | - 'only-disabled', |
|
| 55 | - null, |
|
| 56 | - InputOption::VALUE_NONE, |
|
| 57 | - 'Limit the hooks you want to remove to those that are not enabled in your conf. ' . |
|
| 58 | - 'By default all hooks get uninstalled' |
|
| 59 | - ) |
|
| 60 | - ->addOption( |
|
| 61 | - 'move-existing-to', |
|
| 62 | - null, |
|
| 63 | - InputOption::VALUE_OPTIONAL, |
|
| 64 | - 'Move existing hooks to this directory' |
|
| 65 | - ); |
|
| 40 | + ->setDescription('Remove all git hooks from your .git/hooks directory') |
|
| 41 | + ->setHelp('Remove all git hooks from your .git/hooks directory') |
|
| 42 | + ->addArgument( |
|
| 43 | + 'hook', |
|
| 44 | + InputArgument::OPTIONAL, |
|
| 45 | + 'Remove only this one hook. By default all hooks get uninstalled' |
|
| 46 | + ) |
|
| 47 | + ->addOption( |
|
| 48 | + 'force', |
|
| 49 | + 'f', |
|
| 50 | + InputOption::VALUE_NONE, |
|
| 51 | + 'Force install without confirmation' |
|
| 52 | + ) |
|
| 53 | + ->addOption( |
|
| 54 | + 'only-disabled', |
|
| 55 | + null, |
|
| 56 | + InputOption::VALUE_NONE, |
|
| 57 | + 'Limit the hooks you want to remove to those that are not enabled in your conf. ' . |
|
| 58 | + 'By default all hooks get uninstalled' |
|
| 59 | + ) |
|
| 60 | + ->addOption( |
|
| 61 | + 'move-existing-to', |
|
| 62 | + null, |
|
| 63 | + InputOption::VALUE_OPTIONAL, |
|
| 64 | + 'Move existing hooks to this directory' |
|
| 65 | + ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |