Skip to content

Commit 931b2c3

Browse files
authored
Merge pull request #26 from tonysm/install-cmd-tweaks
Fix installation command not overriding empty app.css files (default Laravel install)
2 parents 0bb35ef + fdd0167 commit 931b2c3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

config/tailwindcss.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
| @see https://github.com/tailwindlabs/tailwindcss/releases to know the version availables.
4040
|
4141
*/
42-
'version' => env('TAILWINDCSS_CLI_VERSION', 'v3.3.2'),
42+
'version' => env('TAILWINDCSS_CLI_VERSION', 'v3.3.5'),
4343
];

src/Commands/InstallCommand.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ private function ensureTailwindConfigExists()
4444
to: base_path('tailwind.config.js'),
4545
);
4646

47-
$this->copyStubToAppIfMissing(
48-
stub: __DIR__ . '/../../stubs/resources/css/app.css',
49-
to: resource_path('css/app.css'),
50-
);
47+
if (! File::exists($appCssFilePath = resource_path('css/app.css')) || empty(trim(File::get($appCssFilePath)))) {
48+
$this->copyStubToApp(
49+
stub: __DIR__ . '/../../stubs/resources/css/app.css',
50+
to: $appCssFilePath,
51+
);
52+
}
5153

5254
return self::SUCCESS;
5355
});

0 commit comments

Comments
 (0)