From 42b79374425e7e5ce3c0d73a89bccf935fa9c835 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Tue, 30 Aug 2011 11:53:40 +0200 Subject: [PATCH] [command] Fixed output + test if file exists in data-sql command --- Command/DataSqlCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Command/DataSqlCommand.php b/Command/DataSqlCommand.php index c7c3ea2..d1e76ad 100644 --- a/Command/DataSqlCommand.php +++ b/Command/DataSqlCommand.php @@ -47,6 +47,10 @@ EOT $filesystem = new Filesystem(); + if (!is_dir($xmlDumpDir)) { + $filesystem->mkdir($xmlDumpDir); + } + $finder = new Finder(); foreach($finder->name('*_data.xml')->in($xmlDumpDir) as $data) { $filesystem->copy((string) $data, $schemaDir . $data->getFilename()); @@ -62,7 +66,7 @@ EOT $filesystem->remove($data); } - $this->summary($output, 'propel-data-sql'); + $this->writeSummary($output, 'propel-data-sql'); $output->writeln(sprintf('SQL from XML data dump file is in %s.', $sqlDir)); } }