Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for both yaml and yml file extensions. #229

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading