mirror of
https://github.com/opdavies/build-configs.git
synced 2025-02-02 05:47:32 +00:00
refactor(astro): create TemplateFile directly
This commit is contained in:
parent
c9faf7bda3
commit
e7fc07fd54
|
@ -28,17 +28,11 @@ final class CreateListOfFilesToGenerate
|
||||||
switch (strtolower($configurationDataDto->type)) {
|
switch (strtolower($configurationDataDto->type)) {
|
||||||
case (strtolower(ProjectType::Astro->name)):
|
case (strtolower(ProjectType::Astro->name)):
|
||||||
$filesToGenerate = collect([
|
$filesToGenerate = collect([
|
||||||
['astro/.envrc', '.envrc'],
|
new TemplateFile(data: 'astro/.envrc', name: '.envrc'),
|
||||||
['astro/.gitignore', '.gitignore'],
|
new TemplateFile(data: 'astro/.gitignore', name: '.gitignore'),
|
||||||
['astro/flake.nix', 'flake.nix'],
|
new TemplateFile(data: 'astro/flake.nix', name: 'flake.nix'),
|
||||||
['astro/tsconfig.json', 'tsconfig.json'],
|
new TemplateFile(data: 'astro/tsconfig.json', name: 'tsconfig.json'),
|
||||||
])->map(function (array $file) {
|
]);
|
||||||
return new TemplateFile(
|
|
||||||
data: $file[0],
|
|
||||||
name: $file[1],
|
|
||||||
path: null,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (strtolower(ProjectType::Drupal->name)):
|
case (strtolower(ProjectType::Drupal->name)):
|
||||||
|
|
Loading…
Reference in a new issue