Skip to content
Snippets Groups Projects

Issue #3231992: Make the staged sites/default writable before cleaning

Merged Issue #3231992: Make the staged sites/default writable before cleaning
1 unresolved thread
1 unresolved thread
Files
2
+ 5
2
@@ -19,6 +19,7 @@ use PhpTuf\ComposerStager\Domain\CleanerInterface;
@@ -19,6 +19,7 @@ use PhpTuf\ComposerStager\Domain\CleanerInterface;
use PhpTuf\ComposerStager\Domain\CommitterInterface;
use PhpTuf\ComposerStager\Domain\CommitterInterface;
use PhpTuf\ComposerStager\Domain\StagerInterface;
use PhpTuf\ComposerStager\Domain\StagerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
/**
/**
* Defines a service to perform updates.
* Defines a service to perform updates.
@@ -277,8 +278,10 @@ class Updater {
@@ -277,8 +278,10 @@ class Updater {
* Cleans the current update.
* Cleans the current update.
*/
*/
public function clean(): void {
public function clean(): void {
if (is_dir($this->getStageDirectory())) {
$dir = $this->getStageDirectory();
$this->cleaner->clean($this->getStageDirectory());
if (is_dir($dir)) {
 
(new SymfonyFilesystem())->chmod($dir, 0777);
 
$this->cleaner->clean($dir);
}
}
$this->state->delete(static::STATE_KEY);
$this->state->delete(static::STATE_KEY);
}
}
Loading