Skip to content

Commit

Permalink
Run Pest
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrancodes committed Mar 26, 2024
1 parent 8963efb commit da84d1b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Rules/BranchNameRegex.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
{
$pattern = $this->data['subdomain_pattern'];

if (!empty($pattern) && !preg_match($pattern, $value)) {
if (! empty($pattern) && ! preg_match($pattern, $value)) {
$fail('The subdomain regex pattern must be match with the branch name.');
}
}
Expand Down
1 change: 0 additions & 1 deletion app/Services/Forge/Pipeline/CreateDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace App\Services\Forge\Pipeline;

use App\Actions\GenerateStandardizedBranchName;
use App\Services\Forge\ForgeService;
use App\Traits\Outputifier;
use Closure;
Expand Down
6 changes: 3 additions & 3 deletions app/Services/Forge/Pipeline/EnableInertiaSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ protected function addDaemonToStartInertiaSsr(ForgeService $service): void
$service->forge->createDaemon($service->server->id, [
'command' => 'php artisan inertia:start-ssr',
'user' => 'forge',
'directory' => $service->siteDirectory()
'directory' => $service->siteDirectory(),
]);
}

protected function addCommandToStopInertiaOnReDeploy(ForgeService $service): void
{
$script = $service->forge->siteDeploymentScript($service->server->id, $service->site->id);

if (!str_contains($script, $command = 'php artisan inertia:stop-ssr')) {
if (! str_contains($script, $command = 'php artisan inertia:stop-ssr')) {
$this->information('Including stop command for Inertia SSR in deploy script.');

$service->forge->updateSiteDeploymentScript(
$service->server->id,
$service->site->id,
$script . "\n\n$command"
$script."\n\n$command"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/valiadtion.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
*/

'attributes' => [
'db_name' => 'FORGE_DB_NAME'
'db_name' => 'FORGE_DB_NAME',
],

];
2 changes: 1 addition & 1 deletion tests/Feature/Validations/BranchNameRegexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
test('it validates the subdomain pattern matches the branch name', function ($data, $failed) {
$validator = Validator::make($data, [
'branch' => ['required', new BranchNameRegex],
'subdomain_pattern' => ['string']
'subdomain_pattern' => ['string'],
]);

expect($validator->fails())->toBe($failed);
Expand Down

0 comments on commit da84d1b

Please sign in to comment.