From 521303d5261a893841dd03fb237203ea481d1b19 Mon Sep 17 00:00:00 2001 From: Sergey Romanenko Date: Mon, 11 Jul 2022 22:02:30 +0300 Subject: [PATCH] Sitemap 3.0.1 --- CHANGELOG.md | 7 +++++++ plugin.yaml | 2 +- .../Console/Commands/Sitemap/SitemapGenerateCommand.php | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1946cda..5621e37 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ + +# [3.0.1](https://github.com/flextype-plugins/sitemap/compare/v3.0.0...v3.0.1) (2022-07-11) + +### Bug Fixes + +* **console** fix issue with sitemap generate command if destination directory does not exist. + # [3.0.0](https://github.com/flextype-plugins/sitemap/compare/v2.10.0...v3.0.0) (2022-07-11) diff --git a/plugin.yaml b/plugin.yaml index 2983614..25b2765 100755 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: Sitemap -version: 3.0.0 +version: 3.0.1 description: Provide automatically generated XML sitemap. author: name: Sergey Romanenko diff --git a/src/core/Console/Commands/Sitemap/SitemapGenerateCommand.php b/src/core/Console/Commands/Sitemap/SitemapGenerateCommand.php index 0ea1bb9..a055e51 100644 --- a/src/core/Console/Commands/Sitemap/SitemapGenerateCommand.php +++ b/src/core/Console/Commands/Sitemap/SitemapGenerateCommand.php @@ -53,7 +53,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int registry()->set('flextype.settings.base_path', ''); } + filesystem()->directory($staticSitemapPath)->ensureExists(0755, true); + filesystem()->directory($staticSitemapPath . '/' . FLEXTYPE_PROJECT_NAME . '/plugins/sitemap/views/templates')->ensureExists(0755, true); + $saveResult = filesystem()->file($staticSitemapPath . '/sitemap.xml')->put((new Sitemap())->fetch()); + $saveResult = filesystem()->file(FLEXTYPE_PATH_PROJECT . '/plugins/sitemap/views/templates/sitemap.xsl')->copy($staticSitemapPath . '/' . FLEXTYPE_PROJECT_NAME . '/plugins/sitemap/views/templates/sitemap.xsl'); if ($saveResult) { $output->write(