Skip to content
Snippets Groups Projects
Commit 9ce9b7bf authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3273006 by tedbow: Uninstalling package_manager with drush gives a...

Issue #3273006 by tedbow: Uninstalling package_manager with drush gives a warning if no staging directory exists
parent dde51df8
No related branches found
No related tags found
1 merge request!251Issue #3273006: Uninstalling package_manager with drush gives a warning if no staging directory exists
......@@ -364,18 +364,22 @@ class Stage {
}
$this->dispatch(new PreDestroyEvent($this));
// Delete the staging root and everything in it.
try {
$this->fileSystem->deleteRecursive($this->getStagingRoot(), function (string $path): void {
$this->fileSystem->chmod($path, 0777);
});
}
catch (FileException $e) {
// Deliberately swallow the exception so that the stage will be marked
// as available and the post-destroy event will be fired, even if the
// staging area can't actually be deleted. The file system service logs
// the exception, so we don't need to do anything else here.
$staging_root = $this->getStagingRoot();
// If the staging root exists, delete it and everything in it.
if (file_exists($staging_root)) {
try {
$this->fileSystem->deleteRecursive($staging_root, function (string $path): void {
$this->fileSystem->chmod($path, 0777);
});
}
catch (FileException $e) {
// Deliberately swallow the exception so that the stage will be marked
// as available and the post-destroy event will be fired, even if the
// staging area can't actually be deleted. The file system service logs
// the exception, so we don't need to do anything else here.
}
}
$this->markAsAvailable();
$this->dispatch(new PostDestroyEvent($this));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment