Skip to content

Commit

Permalink
Merge pull request #229 from buggregator/feature/228
Browse files Browse the repository at this point in the history
Add support for both `yaml` and `yml` file extensions.
  • Loading branch information
butschster authored Jul 28, 2024
2 parents 15a57b7 + a9707fd commit ab82861
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class OrmDefaultD93e77c9f5556975e93bfbc969442732 extends Migration

public function up(): void
{
$defaultProject = $this->getRepository()->findOne(['key' => Project::DEFAULT_KEY]);

// Ignore if default project already exists
if ($defaultProject !== null) {
return;
}

$this->getEntityManager()
->persist(new Project(Key::create(Project::DEFAULT_KEY), 'Default project'))
->run();
Expand All @@ -25,6 +32,7 @@ public function up(): void
public function down(): void
{
$defaultProject = $this->getRepository()->findOne(['key' => Project::DEFAULT_KEY]);
// Delete default project if exists
if ($defaultProject !== null) {
$this->getEntityManager()->delete($defaultProject)->run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(

public function findAll(): iterable
{
$this->finder->files()->in($this->directory)->name('*.project.yaml');
$this->finder->files()->in($this->directory)->name(['*.project.yaml', '*.project.yml']);

foreach ($this->finder as $file) {
try {
Expand Down
6 changes: 4 additions & 2 deletions app/modules/Webhooks/Application/WebhooksBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ public function defineSingletons(): array
finder: \Symfony\Component\Finder\Finder::create()
->files()
->in($dirs->get('runtime') . '/configs')
->name('*.webhook.yaml'),
->name(['*.webhook.yaml', '*.webhook.yml']),
),
],
),

WebhookLocatorInterface::class => static fn(YamlFileWebhookLocator $locator): WebhookLocatorInterface => new CompositeWebhookLocator([
WebhookLocatorInterface::class => static fn(
YamlFileWebhookLocator $locator,
): WebhookLocatorInterface => new CompositeWebhookLocator([
$locator,
]),

Expand Down

0 comments on commit ab82861

Please sign in to comment.