Skip to content

Commit b19187a

Browse files
committed
fix: remarks from reviewer
1 parent b1e5249 commit b19187a

File tree

3 files changed

+4
-84
lines changed

3 files changed

+4
-84
lines changed

resources/.env.example

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/Commands/InitCommand.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
class InitCommand extends Command implements Isolatable
1919
{
20-
public const string RESOURCES_PATH = 'vendor/ronasit/laravel-project-initializator/resources';
21-
2220
public const string TEMPLATES_PATH = 'vendor/ronasit/laravel-project-initializator/resources/md/readme';
2321

2422
public const array RESOURCES_ITEMS = [
@@ -92,21 +90,16 @@ public function handle(): void
9290

9391
$this->appUrl = $this->ask('Please enter an application URL', "https://api.dev.{$kebabName}.com");
9492

95-
if (!file_exists(filename: '.env.example')) {
96-
$envExamplePath = base_path(DIRECTORY_SEPARATOR . self::RESOURCES_PATH . DIRECTORY_SEPARATOR . '.env.example');
97-
copy($envExamplePath, '.env.example');
98-
}
99-
100-
if (!file_exists('.env.development')) {
101-
copy('.env.example', '.env.development');
102-
}
103-
10493
$envFile = (file_exists('.env')) ? '.env' : '.env.example';
10594

10695
$this->createOrUpdateConfigFile($envFile, '=', [
10796
'APP_NAME' => $this->appName,
10897
]);
10998

99+
if (!file_exists('.env.development')) {
100+
copy('.env.example', '.env.development');
101+
}
102+
110103
$this->createOrUpdateConfigFile('.env.development', '=', [
111104
'APP_NAME' => $this->appName,
112105
'APP_URL' => $this->appUrl,

tests/InitCommandTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public function testRunWithoutAdminAndReadmeCreationConvertAppNameToPascalCaseTe
1414
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
1515

1616
$this->mockCopy(
17-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
1817
['.env.example', '.env.development'],
1918
);
2019

@@ -85,7 +84,6 @@ public function testRunWithoutAdminAndReadmeCreation()
8584
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
8685

8786
$this->mockCopy(
88-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
8987
['.env.example', '.env.development'],
9088
);
9189

@@ -158,7 +156,6 @@ public function testRunWithAdminAndWithoutReadmeCreation()
158156
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
159157

160158
$this->mockCopy(
161-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
162159
['.env.example', '.env.development'],
163160
);
164161

@@ -235,7 +232,6 @@ public function testRunWithAdminAndDefaultReadmeCreation()
235232
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
236233

237234
$this->mockCopy(
238-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
239235
['.env.example', '.env.development'],
240236
);
241237

@@ -441,7 +437,6 @@ public function testRunWithAdminAndPartialReadmeCreation()
441437
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
442438

443439
$this->mockCopy(
444-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
445440
['.env.example', '.env.development'],
446441
);
447442

@@ -582,7 +577,6 @@ public function testRunWithAdminAndFullReadmeCreationAndRemovingInitializatorIns
582577
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
583578

584579
$this->mockCopy(
585-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
586580
['.env.example', '.env.development'],
587581
);
588582

@@ -757,7 +751,6 @@ public function testRunWithoutAdminAndUsingTelescope()
757751
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
758752

759753
$this->mockCopy(
760-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
761754
['.env.example', '.env.development'],
762755
);
763756

@@ -902,7 +895,6 @@ public function testRunWithClerkMobileAppWithPintInstalled(): void
902895
$this->mockChangeConfig('config/auto-doc.php', 'auto_doc.php', 'auto_doc_after_changes.php');
903896

904897
$this->mockCopy(
905-
[base_path('/vendor/ronasit/laravel-project-initializator/resources/.env.example'), '.env.example'],
906898
['.env.example', '.env.development'],
907899
);
908900

0 commit comments

Comments
 (0)