From fa1774b5509906b3abfe7c37e9a2e55545f1ba02 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 21 Feb 2023 08:29:09 +0000 Subject: [PATCH] feat: create a justfile Refs: #18 --- src/Console/Command/BuildConfigurationCommand.php | 1 + templates/justfile.twig | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 templates/justfile.twig diff --git a/src/Console/Command/BuildConfigurationCommand.php b/src/Console/Command/BuildConfigurationCommand.php index 9110fd9..d2dcd26 100644 --- a/src/Console/Command/BuildConfigurationCommand.php +++ b/src/Console/Command/BuildConfigurationCommand.php @@ -115,6 +115,7 @@ final class BuildConfigurationCommand extends Command $this->filesToGenerate->push(['env.example', '.env.example']); $this->filesToGenerate->push(['Dockerfile', 'Dockerfile']); + $this->filesToGenerate->push(['justfile', 'justfile']); if (isset($configurationData['dockerCompose']) && $configurationData['dockerCompose'] !== null) { $this->filesToGenerate->push(['docker-compose.yaml', 'docker-compose.yaml']); diff --git a/templates/justfile.twig b/templates/justfile.twig new file mode 100644 index 0000000..be5734b --- /dev/null +++ b/templates/justfile.twig @@ -0,0 +1,15 @@ +default: + @just --list + +{% if "php" is same as language %} +composer *args: + {{ "just _exec php composer {{ args }}" | raw }} +{% endif %} + +{% if "drupal-project" is same as type %} +drush *args: + {{ "just _exec php drush {{ args }}" | raw }} +{% endif %} + +_exec +args: + {{ "docker compose exec {{ args }}" | raw }}