Skip to content

Commit

Permalink
create folder if not exists in migration command
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed Oct 14, 2024
1 parent 0c1044f commit 6a438d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Yaml\Yaml;

class ConvertExportDefinitionsToYaml extends Command
Expand All @@ -25,6 +26,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$filePath = $input->getArgument('file');
$data = require $filePath;

$fs = new Filesystem();
if (!$fs->exists('var/config/export-definitions')) {
$fs->mkdir('var/config/export-definitions');
}

foreach ($data as $entry) {

$fileName = $entry['id'] . '.yaml';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Yaml\Yaml;

class ConvertImportDefinitionsToYaml extends Command
Expand All @@ -24,6 +25,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$filePath = $input->getArgument('file');
$data = require $filePath;

$fs = new Filesystem();
if (!$fs->exists('var/config/import-definitions')) {
$fs->mkdir('var/config/import-definitions');
}

foreach ($data as $entry) {

$fileName = $entry['id'] . '.yaml';
Expand Down

0 comments on commit 6a438d5

Please sign in to comment.