Skip to content

Commit eabdd39

Browse files
committed
Fetch correct homepage URL from composer.json
1 parent ca86361 commit eabdd39

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/Command/Markdown/GeneratorCommand.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,6 @@ private function promptName(SymfonyStyle $io): string
137137
return $name;
138138
}
139139

140-
private function isFieldFilled(?string $string): bool
141-
{
142-
return !empty($string) && strlen($string) > 0;
143-
}
144-
145140
private function promptHeading(SymfonyStyle $io): string
146141
{
147142
$heading = $io->ask('Project Heading/Summary');
@@ -188,7 +183,7 @@ private function promptAuthor(SymfonyStyle $io): string
188183

189184
private function promptEmail(SymfonyStyle $io): string
190185
{
191-
$email = $io->ask('Valid Author Email (will also be used for your gravatar)', $this->composerData['authors'][0]['name']);
186+
$email = $io->ask('Valid Author Email (will also be used for your gravatar)', $this->composerData['authors'][0]['email']);
192187

193188
if (!$this->isFieldFilled($email)) {
194189
throw new EmptyFieldException('Author email is required.');
@@ -204,7 +199,9 @@ private function promptEmail(SymfonyStyle $io): string
204199

205200
private function promptHomepageUrl(SymfonyStyle $io): string
206201
{
207-
$webpage = $io->ask('Valid Author Webpage (e.g. https://pierre.com)');
202+
$personalHomepage = !empty($this->composerData['authors'][0]['homepage']) ? $this->composerData['authors'][0]['homepage'] : $this->composerData['homepage'];
203+
204+
$webpage = $io->ask('Valid Author Webpage (e.g. https://pierre.com)', $personalHomepage);
208205

209206

210207
if (!$this->isFieldFilled($webpage)) {

0 commit comments

Comments
 (0)