Skip to content

Commit

Permalink
Installer: Support reverting asset publication
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Jan 31, 2019
1 parent 8ad3269 commit ed9591c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Install/Steps/PublishAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,7 +42,17 @@ public function run()
{
(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";
}
}

0 comments on commit ed9591c

Please sign in to comment.