Skip to content

Commit

Permalink
Merge branch 'master' into robdekort/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Oct 15, 2024
2 parents e7e6501 + b48d620 commit 83acc32
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
10 changes: 2 additions & 8 deletions src/Concerns/RunsCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@ trait RunsCommands
/**
* Run the given command.
*
* @param string $command
* @param string|null $workingPath
* @param bool $disableOutput
* @return Process
*/
protected function runCommand(string $command, string $workingPath = null, bool $disableOutput = false)
protected function runCommand(string $command, ?string $workingPath = null, bool $disableOutput = false)
{
return $this->runCommands([$command], $workingPath, $disableOutput);
}

/**
* Run the given commands.
*
* @param array $commands
* @param string|null $workingPath
* @param bool $disableOutput
* @return Process
*/
protected function runCommands(array $commands, string $workingPath = null, bool $disableOutput = false)
protected function runCommands(array $commands, ?string $workingPath = null, bool $disableOutput = false)
{
if (! $this->output->isDecorated()) {
$commands = array_map(function ($value) {
Expand Down
20 changes: 6 additions & 14 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
use Symfony\Component\Process\Process;

use function Laravel\Prompts\confirm;
use function Laravel\Prompts\error;
use function Laravel\Prompts\intro;
use function Laravel\Prompts\multiselect;
use function Laravel\Prompts\select;
use function Laravel\Prompts\suggest;
use function Laravel\Prompts\text;
Expand Down Expand Up @@ -681,14 +679,14 @@ protected function installSsg()
}

$this->output->write(PHP_EOL);
intro("Installing the Static Site Generator addon...");
intro('Installing the Static Site Generator addon...');

$statusCode = (new Please($this->output))
->cwd($this->absolutePath)
->run("install:ssg");
->run('install:ssg');

if ($statusCode !== 0) {
throw new RuntimeException("There was a problem installing the Static Site Generator addon!");
throw new RuntimeException('There was a problem installing the Static Site Generator addon!');
}

return $this;
Expand Down Expand Up @@ -830,8 +828,6 @@ protected function initializeGitRepository()

/**
* Check if Git is installed.
*
* @return bool
*/
protected function isGitInstalled(): bool
{
Expand All @@ -844,8 +840,6 @@ protected function isGitInstalled(): bool

/**
* Return the local machine's default Git branch if set or default to `main`.
*
* @return string
*/
protected function defaultBranch(): string
{
Expand Down Expand Up @@ -928,8 +922,6 @@ protected function pushToGithub()

/**
* Check if GitHub's GH CLI tool is installed.
*
* @return bool
*/
protected function isGhInstalled(): bool
{
Expand Down Expand Up @@ -999,11 +991,11 @@ protected function askToEnableStatamicPro()
$this->pro = confirm(
label: 'Do you want to enable Statamic Pro?',
default: true,
hint: "Statamic Pro is required for some features. Like Multi-site, the Git integration, and more."
hint: 'Statamic Pro is required for some features. Like Multi-site, the Git integration, and more.'
);

if ($this->pro) {
$this->output->write(" Before your site goes live, you will need to purchase a license on <info>statamic.com</info>.".PHP_EOL.PHP_EOL);
$this->output->write(' Before your site goes live, you will need to purchase a license on <info>statamic.com</info>.'.PHP_EOL.PHP_EOL);
}

return $this;
Expand Down Expand Up @@ -1074,7 +1066,7 @@ protected function askToSpreadJoy()
}

$response = select('Would you like to spread the joy of Statamic by starring the repo?', [
$yes = "Absolutely",
$yes = 'Absolutely',
$no = 'Maybe later',
], $no);

Expand Down
2 changes: 0 additions & 2 deletions src/Please.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class Please

/**
* Instantiate Statamic `please` command wrapper.
*
* @param OutputInterface $output
*/
public function __construct(OutputInterface $output)
{
Expand Down
2 changes: 0 additions & 2 deletions src/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ protected function configure()
/**
* Execute the command.
*
* @param InputInterface $input
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
Expand Down
2 changes: 0 additions & 2 deletions src/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ protected function configure()
/**
* Execute the command.
*
* @param InputInterface $input
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
Expand Down

0 comments on commit 83acc32

Please sign in to comment.