mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:53:27 +08:00
Installer: Support reverting asset publication
This commit is contained in:
parent
8ad326941f
commit
ed9591c16f
@ -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";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user