@@ 27-40 (lines=14) @@ | ||
24 | */ |
|
25 | final class Hooks |
|
26 | { |
|
27 | public static function addHooks() : void |
|
28 | { |
|
29 | $hooksDirectory = self::rootDir() . '/.git/hooks'; |
|
30 | $fileSystem = new Filesystem(); |
|
31 | ||
32 | try { |
|
33 | if ($fileSystem->exists($hooksDirectory)) { |
|
34 | $fileSystem->remove($hooksDirectory); |
|
35 | } |
|
36 | $fileSystem->symlink(__DIR__ . '/../Hooks', $hooksDirectory, true); |
|
37 | } catch (\Exception $exception) { |
|
38 | echo sprintf("Something wrong happens during the symlink process: \n%s\n", $exception->getMessage()); |
|
39 | } |
|
40 | } |
|
41 | ||
42 | public static function buildDistFile() : void |
|
43 | { |
|
@@ 42-55 (lines=14) @@ | ||
39 | } |
|
40 | } |
|
41 | ||
42 | public static function buildDistFile() : void |
|
43 | { |
|
44 | $distFile = self::rootDir() . '/.lin3s_cs.yml.dist'; |
|
45 | $fileSystem = new Filesystem(); |
|
46 | ||
47 | try { |
|
48 | if ($fileSystem->exists($distFile)) { |
|
49 | return; |
|
50 | } |
|
51 | $fileSystem->copy(self::lin3sCsRootDir() . '/.lin3s_cs.yml.dist', $distFile); |
|
52 | } catch (\Exception $exception) { |
|
53 | echo sprintf("Something wrong happens during the touch process: \n%s\n", $exception->getMessage()); |
|
54 | } |
|
55 | } |
|
56 | ||
57 | public static function addFiles() : void |
|
58 | { |