| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2.0393 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 2 | public function pushDirectoryContentToRepository(string $outputDirectory, string $githubRepository) |
|
| 28 | { |
||
| 29 | 2 | FilesystemChecker::ensureDirectoryExists($outputDirectory); |
|
| 30 | |||
| 31 | 1 | $git = (new GitWrapper())->init($outputDirectory); |
|
| 32 | |||
| 33 | 1 | if (getenv('TRAVIS')) { |
|
| 34 | 1 | $git->config('user.email', self::CONFIG_EMAIL); |
|
| 35 | 1 | $git->config('user.name', self::CONFIG_NAME); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | $git->checkout('gh-pages', [ |
|
| 39 | 1 | 'orphan' => true, |
|
| 40 | ]); |
||
| 41 | 1 | $git->add('.'); |
|
| 42 | 1 | $git->commit('Regenerate output'); |
|
| 43 | 1 | $git->addRemote('origin', $githubRepository); |
|
| 44 | $git->push('origin', 'gh-pages', [ |
||
| 45 | 'force' => true, |
||
| 46 | 'quiet' => true, |
||
| 47 | ]); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |