Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pint #86

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Pint #86

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -927,8 +921,6 @@ protected function pushToGithub()

/**
* Check if GitHub's GH CLI tool is installed.
*
* @return bool
*/
protected function isGhInstalled(): bool
{
Expand Down Expand Up @@ -998,11 +990,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 @@ -1073,7 +1065,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