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