2016-07-23 12:36:31 +01:00
|
|
|
#include "CreateServerResourcePacksFolder.h"
|
|
|
|
#include "minecraft/MinecraftInstance.h"
|
|
|
|
#include "launch/LaunchTask.h"
|
2016-12-12 13:36:42 +00:00
|
|
|
#include "FileSystem.h"
|
2016-07-23 12:36:31 +01:00
|
|
|
|
|
|
|
CreateServerResourcePacksFolder::CreateServerResourcePacksFolder(LaunchTask* parent): LaunchStep(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CreateServerResourcePacksFolder::executeTask()
|
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
auto instance = m_parent->instance();
|
|
|
|
std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
2018-07-27 22:57:09 +01:00
|
|
|
if(!FS::ensureFolderPathExists(FS::PathCombine(minecraftInstance->gameRoot(), "server-resource-packs")))
|
2018-07-15 13:51:05 +01:00
|
|
|
{
|
|
|
|
emit logLine(tr("Couldn't create the 'server-resource-packs' folder"), MessageLevel::Error);
|
|
|
|
}
|
|
|
|
emitSucceeded();
|
2016-07-23 12:36:31 +01:00
|
|
|
}
|