Skip to content

Commit

Permalink
Merge pull request #9 from fetzerch/systemdir
Browse files Browse the repository at this point in the history
[LibretroResources] Ensure that system directory exists
  • Loading branch information
garbear authored Nov 13, 2016
2 parents 8d05481 + 0ea6677 commit 000db09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libretro/LibretroResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,17 @@ void CLibretroResources::Initialize(ADDON::CHelper_libXBMC_addon* addon, const g

// Set system path to first resource path discovered
if (m_systemDirectory.empty())
{
m_systemDirectory = resourcePath + "/" LIBRETRO_SYSTEM_DIRECTORY_NAME;

// Ensure folder exists
if (!m_addon->DirectoryExists(m_systemDirectory.c_str()))
{
dsyslog("Creating system directory: %s", m_systemDirectory.c_str());
m_addon->CreateDirectory(m_systemDirectory.c_str());
}
}

m_resourceDirectories.push_back(std::move(resourcePath));
}

Expand Down

0 comments on commit 000db09

Please sign in to comment.