Make user cache path adjustable by env var.

This commit is contained in:
3GO 2023-06-22 13:35:48 +00:00 committed by Mark Roszko
parent 355575e477
commit 206f66aee2
1 changed files with 9 additions and 0 deletions

View File

@ -320,9 +320,18 @@ wxString PATHS::GetStockDemosPath()
wxString PATHS::GetUserCachePath()
{
wxString envPath;
wxFileName tmp;
tmp.AssignDir( KIPLATFORM::ENV::GetUserCachePath() );
// Use KICAD_CACHE_HOME to allow the user to force a specific cache path.
if( wxGetEnv( wxT( "KICAD_CACHE_HOME" ), &envPath ) && !envPath.IsEmpty() )
{
// Override the assignment above with KICAD_CACHE_HOME
tmp.AssignDir( envPath );
}
tmp.AppendDir( KICAD_PATH_STR );
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );