From b9a3ef73c08fca7345bacaa765404f5d54ac21e3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 27 Feb 2016 16:44:46 +0000 Subject: [PATCH] Allow skipping author, fixes #4969 --- src/Composer/Command/InitCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index b16fa21b3..818c8ba14 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -174,6 +174,7 @@ EOT // package names must be in the format foo/bar $name = $name . '/' . $name; } + $name = strtolower($name); } else { if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) { throw new \InvalidArgumentException( @@ -217,8 +218,11 @@ EOT $self = $this; $author = $io->askAndValidate( - 'Author ['.$author.']: ', + 'Author ['.$author.', n to skip]: ', function ($value) use ($self, $author) { + if ($value === 'n' || $value === 'no') { + return; + } $value = $value ?: $author; $author = $self->parseAuthorString($value);