Skip to content

Commit

Permalink
fix: add spacing around echo outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
peaklabs-dev committed Jan 16, 2025
1 parent 0ced6a4 commit e9d688d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions database/seeders/RootUserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public function run(): void
{
try {
if (User::where('id', 0)->exists()) {
echo " INFO Root user already exists. Skipping creation.\n";
echo "\n INFO Root user already exists. Skipping creation.\n\n";

return;
}

if (! env('ROOT_USER_EMAIL') || ! env('ROOT_USER_PASSWORD')) {
echo " ERROR ROOT_USER_EMAIL and ROOT_USER_PASSWORD environment variables are required for root user creation.\n";
echo "\n ERROR ROOT_USER_EMAIL and ROOT_USER_PASSWORD environment variables are required for root user creation.\n\n";

return;
}
Expand All @@ -37,10 +37,11 @@ public function run(): void
]);

if ($validator->fails()) {
echo " ERROR Invalid Root User Environment Variables\n";
echo "\n ERROR Invalid Root User Environment Variables\n";
foreach ($validator->errors()->all() as $error) {
echo "{$error}\n";
}
echo "\n";

return;
}
Expand All @@ -52,9 +53,9 @@ public function run(): void
'email' => env('ROOT_USER_EMAIL'),
'password' => Hash::make(env('ROOT_USER_PASSWORD')),
]);
echo " SUCCESS Root user created successfully.\n";
echo "\n SUCCESS Root user created successfully.\n\n";
} catch (\Exception $e) {
echo " ERROR Failed to create root user: {$e->getMessage()}\n";
echo "\n ERROR Failed to create root user: {$e->getMessage()}\n\n";

return;
}
Expand All @@ -64,12 +65,12 @@ public function run(): void
['id' => 0],
['is_registration_enabled' => false]
);
echo " SUCCESS Registration has been disabled.\n";
echo "\n SUCCESS Registration has been disabled.\n\n";
} catch (\Exception $e) {
echo " ERROR Failed to update instance settings: {$e->getMessage()}\n";
echo "\n ERROR Failed to update instance settings: {$e->getMessage()}\n\n";
}
} catch (\Exception $e) {
echo " ERROR An unexpected error occurred: {$e->getMessage()}\n";
echo "\n ERROR An unexpected error occurred: {$e->getMessage()}\n\n";
}
}
}

0 comments on commit e9d688d

Please sign in to comment.