Skip to content

Commit a8d5c2d

Browse files
committed
formatting
1 parent d487f85 commit a8d5c2d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/NewCommand.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function configure()
2727
->addArgument('name', InputArgument::REQUIRED)
2828
->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest "development" release')
2929
->addOption('git', null, InputOption::VALUE_NONE, 'Initialize a Git repository')
30-
->addOption('branch', null, InputOption::VALUE_REQUIRED, 'Set your branch name, defaults to "main"')
30+
->addOption('branch', null, InputOption::VALUE_REQUIRED, 'The branch that should be created for a new repository', 'main')
3131
->addOption('github', null, InputOption::VALUE_OPTIONAL, 'Create a new repository on GitHub', false)
3232
->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for')
3333
->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding')
@@ -211,7 +211,7 @@ protected function createRepository(string $directory, InputInterface $input, Ou
211211
$branch = $input->getOption('branch') ?: 'main';
212212

213213
$commands = [
214-
"git init -q -b $branch .",
214+
"git init -q -b {$branch} .",
215215
'git add .',
216216
'git commit -q -m "Set up a fresh Laravel app"',
217217
];
@@ -267,14 +267,12 @@ protected function pushToGitHub(string $name, string $directory, InputInterface
267267
chdir($directory);
268268

269269
$name = $input->getOption('organization') ? $input->getOption('organization')."/$name" : $name;
270-
271270
$flags = $input->getOption('github') ?: '--private';
272-
273271
$branch = $input->getOption('branch') ?: 'main';
274272

275273
$commands = [
276-
"gh repo create $name -y $flags",
277-
"git -c credential.helper= -c credential.helper='!gh auth git-credential' push -q -u origin $branch",
274+
"gh repo create {$name} -y {$flags}",
275+
"git -c credential.helper= -c credential.helper='!gh auth git-credential' push -q -u origin {$branch}",
278276
];
279277

280278
$this->runCommands($commands, $input, $output, ['GIT_TERMINAL_PROMPT' => 0]);

0 commit comments

Comments
 (0)