Skip to content

Commit edd7352

Browse files
Merge pull request #105 from TheDragonCode/1.x
Welcome message added
2 parents 8ec5d8a + 94bd926 commit edd7352

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app/Commands/ReadCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function handle(): void
4040

4141
protected function welcome(array $includeRepositories, ?array $exceptRepositories): void
4242
{
43+
if ($user = $this->gitHub()->currentUser()) {
44+
Output::success($user, 'WELCOME');
45+
}
46+
4347
if ($includeRepositories) {
4448
$this->bulletList('You specified the following repository name masks:', $includeRepositories);
4549
}

app/Services/GitHub.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Github\Client;
1212
use Github\ResultPager;
1313
use Illuminate\Console\View\Components\Factory;
14+
use Illuminate\Support\Arr;
1415
use Illuminate\Support\Str;
1516

1617
class GitHub
@@ -37,6 +38,11 @@ public function __construct(
3738
protected ResultPager $paginator,
3839
) {}
3940

41+
public function currentUser(): ?string
42+
{
43+
return Arr::get($this->github->me()->show(), 'name');
44+
}
45+
4046
public function repositories(array $repositories): self
4147
{
4248
$this->repositories = $repositories;

0 commit comments

Comments
 (0)