Merge pull request #618 from TheKodeToad/safer-destructive-actions
Fixes https://github.com/PolyMC/PolyMC/issues/948
This commit is contained in:
@ -143,5 +143,9 @@ bool Resource::enable(EnableAction action)
|
||||
bool Resource::destroy()
|
||||
{
|
||||
m_type = ResourceType::UNKNOWN;
|
||||
|
||||
if (FS::trash(m_file_info.filePath()))
|
||||
return true;
|
||||
|
||||
return FS::deletePath(m_file_info.filePath());
|
||||
}
|
||||
|
Reference in New Issue
Block a user