Skip to content

Commit 18c610b

Browse files
committed
Jenova Runtime Update v0.3.9.0 Hotfix 5
- Improved Package Manager Database Handling
1 parent 7a57e54 commit 18c610b

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

Source/package_manager.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,23 @@ static String SolvePackageDestination(const std::string& packageDestination)
5050
}
5151
static String GetPackageDatabasePath()
5252
{
53+
// Get Package Database Path
54+
String pkgDatabasePath;
5355
if (GetPackageRepositoryPath(false).contains(jenova::GlobalSettings::JenovaPackageRepositoryPath))
5456
{
55-
return jenova::GetJenovaProjectDirectory() + "Jenova/" + jenova::GlobalSettings::JenovaInstalledPackagesFile;
57+
pkgDatabasePath = jenova::GetJenovaProjectDirectory() + "Jenova/" + jenova::GlobalSettings::JenovaInstalledPackagesFile;
5658
}
57-
return GetPackageRepositoryPath(true) + jenova::GlobalSettings::JenovaInstalledPackagesFile;
59+
else
60+
{
61+
pkgDatabasePath = GetPackageRepositoryPath(true) + jenova::GlobalSettings::JenovaInstalledPackagesFile;
62+
}
63+
64+
// Ensure Package Database Path Exists
65+
filesystem::path dir = filesystem::path(AS_STD_STRING(pkgDatabasePath)).parent_path();
66+
if (!filesystem::exists(dir)) filesystem::create_directories(dir);
67+
68+
// All Good
69+
return pkgDatabasePath;
5870
}
5971

6072
// Configuration

0 commit comments

Comments
 (0)