From d4cdd11533d0dda60549e15024e69cfa0d28adc7 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 31 Jan 2019 22:43:07 +0100 Subject: [PATCH] Installer: Support reverting asset publication --- .../core/src/Install/Steps/PublishAssets.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Install/Steps/PublishAssets.php b/framework/core/src/Install/Steps/PublishAssets.php index 7ec1d767a..b8f20868b 100644 --- a/framework/core/src/Install/Steps/PublishAssets.php +++ b/framework/core/src/Install/Steps/PublishAssets.php @@ -11,10 +11,11 @@ namespace Flarum\Install\Steps; +use Flarum\Install\ReversibleStep; use Flarum\Install\Step; use Illuminate\Filesystem\Filesystem; -class PublishAssets implements Step +class PublishAssets implements Step, ReversibleStep { /** * @var string @@ -41,7 +42,17 @@ class PublishAssets implements Step { (new Filesystem)->copyDirectory( "$this->basePath/vendor/components/font-awesome/webfonts", - "$this->assetPath/fonts" + $this->targetPath() ); } + + public function revert() + { + (new Filesystem)->deleteDirectory($this->targetPath()); + } + + private function targetPath() + { + return "$this->assetPath/fonts"; + } }