@@ -55,8 +55,8 @@ |
||
55 | 55 | ); |
56 | 56 | |
57 | 57 | $io = $this->getMockBuilder(DefaultIO::class) |
58 | - ->disableOriginalConstructor() |
|
59 | - ->getMock(); |
|
58 | + ->disableOriginalConstructor() |
|
59 | + ->getMock(); |
|
60 | 60 | $io->expects($this->once())->method('write'); |
61 | 61 | |
62 | 62 | $add->setIO($io); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | $this->expectException(\Exception::class); |
26 | 26 | |
27 | - $input = new ArrayInput( |
|
27 | + $input = new ArrayInput( |
|
28 | 28 | [ |
29 | 29 | 'hook' => 'pre-commit', |
30 | 30 | '--configuration' => 'foo' |
@@ -51,8 +51,8 @@ |
||
51 | 51 | ]); |
52 | 52 | |
53 | 53 | $io = $this->getMockBuilder(DefaultIO::class) |
54 | - ->disableOriginalConstructor() |
|
55 | - ->getMock(); |
|
54 | + ->disableOriginalConstructor() |
|
55 | + ->getMock(); |
|
56 | 56 | $io->expects($this->once())->method('write'); |
57 | 57 | |
58 | 58 | $add->setIO($io); |
@@ -38,52 +38,52 @@ discard block |
||
38 | 38 | protected function configure() : void |
39 | 39 | { |
40 | 40 | $this->setName('install') |
41 | - ->setDescription('Install git hooks') |
|
42 | - ->setHelp('This command will install the git hooks to your .git directory') |
|
43 | - ->addArgument('hook', InputArgument::OPTIONAL, 'Hook you want to install') |
|
44 | - ->addOption( |
|
45 | - 'configuration', |
|
46 | - 'c', |
|
47 | - InputOption::VALUE_OPTIONAL, |
|
48 | - 'Path to your json configuration', |
|
49 | - getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
50 | - ) |
|
51 | - ->addOption( |
|
52 | - 'force', |
|
53 | - 'f', |
|
54 | - InputOption::VALUE_NONE, |
|
55 | - 'Force to overwrite existing hooks' |
|
56 | - ) |
|
57 | - ->addOption( |
|
58 | - 'git-directory', |
|
59 | - 'g', |
|
60 | - InputOption::VALUE_OPTIONAL, |
|
61 | - 'Path to your .git directory' |
|
62 | - ) |
|
63 | - ->addOption( |
|
64 | - 'vendor-directory', |
|
65 | - null, |
|
66 | - InputOption::VALUE_OPTIONAL, |
|
67 | - 'Path to composers vendor directory' |
|
68 | - ) |
|
69 | - ->addOption( |
|
70 | - 'run-mode', |
|
71 | - 'm', |
|
72 | - InputOption::VALUE_OPTIONAL, |
|
73 | - 'Git hook run mode [local|docker]' |
|
74 | - ) |
|
75 | - ->addOption( |
|
76 | - 'run-exec', |
|
77 | - 'e', |
|
78 | - InputOption::VALUE_OPTIONAL, |
|
79 | - 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
80 | - ) |
|
81 | - ->addOption( |
|
82 | - 'run-path', |
|
83 | - 'p', |
|
84 | - InputOption::VALUE_OPTIONAL, |
|
85 | - 'The path to the CaptainHook executable \'/var/www/html\'' |
|
86 | - ); |
|
41 | + ->setDescription('Install git hooks') |
|
42 | + ->setHelp('This command will install the git hooks to your .git directory') |
|
43 | + ->addArgument('hook', InputArgument::OPTIONAL, 'Hook you want to install') |
|
44 | + ->addOption( |
|
45 | + 'configuration', |
|
46 | + 'c', |
|
47 | + InputOption::VALUE_OPTIONAL, |
|
48 | + 'Path to your json configuration', |
|
49 | + getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
50 | + ) |
|
51 | + ->addOption( |
|
52 | + 'force', |
|
53 | + 'f', |
|
54 | + InputOption::VALUE_NONE, |
|
55 | + 'Force to overwrite existing hooks' |
|
56 | + ) |
|
57 | + ->addOption( |
|
58 | + 'git-directory', |
|
59 | + 'g', |
|
60 | + InputOption::VALUE_OPTIONAL, |
|
61 | + 'Path to your .git directory' |
|
62 | + ) |
|
63 | + ->addOption( |
|
64 | + 'vendor-directory', |
|
65 | + null, |
|
66 | + InputOption::VALUE_OPTIONAL, |
|
67 | + 'Path to composers vendor directory' |
|
68 | + ) |
|
69 | + ->addOption( |
|
70 | + 'run-mode', |
|
71 | + 'm', |
|
72 | + InputOption::VALUE_OPTIONAL, |
|
73 | + 'Git hook run mode [local|docker]' |
|
74 | + ) |
|
75 | + ->addOption( |
|
76 | + 'run-exec', |
|
77 | + 'e', |
|
78 | + InputOption::VALUE_OPTIONAL, |
|
79 | + 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
80 | + ) |
|
81 | + ->addOption( |
|
82 | + 'run-path', |
|
83 | + 'p', |
|
84 | + InputOption::VALUE_OPTIONAL, |
|
85 | + 'The path to the CaptainHook executable \'/var/www/html\'' |
|
86 | + ); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | |
116 | 116 | $installer = new Installer($io, $config, $repo); |
117 | 117 | $installer->setForce(IOUtil::argToBool($input->getOption('force'))) |
118 | - ->setHook(IOUtil::argToString($input->getArgument('hook'))) |
|
119 | - ->setTemplate(Template\Builder::build($config, $repo)) |
|
120 | - ->run(); |
|
118 | + ->setHook(IOUtil::argToString($input->getArgument('hook'))) |
|
119 | + ->setTemplate(Template\Builder::build($config, $repo)) |
|
120 | + ->run(); |
|
121 | 121 | |
122 | 122 | return 0; |
123 | 123 | } |