Skip to content

Commit

Permalink
Merge pull request #26 from tonysm/install-cmd-tweaks
Browse files Browse the repository at this point in the history
Fix installation command not overriding empty app.css files (default Laravel install)
  • Loading branch information
tonysm authored Nov 12, 2023
2 parents 0bb35ef + fdd0167 commit 931b2c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/tailwindcss.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
| @see https://github.com/tailwindlabs/tailwindcss/releases to know the version availables.
|
*/
'version' => env('TAILWINDCSS_CLI_VERSION', 'v3.3.2'),
'version' => env('TAILWINDCSS_CLI_VERSION', 'v3.3.5'),
];
10 changes: 6 additions & 4 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ private function ensureTailwindConfigExists()
to: base_path('tailwind.config.js'),
);

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

return self::SUCCESS;
});
Expand Down

0 comments on commit 931b2c3

Please sign in to comment.