Silence some kicad-cli loading errors on clean installs

This commit is contained in:
Marek Roszko 2023-01-31 20:57:31 -05:00
parent 48e4005111
commit 719be61627
1 changed files with 12 additions and 3 deletions

View File

@ -502,15 +502,24 @@ public:
bool SETTINGS_MANAGER::MigrateIfNeeded()
{
wxFileName path( GetUserSettingsPath(), wxS( "" ) );
wxLogTrace( traceSettings, wxT( "Using settings path %s" ), path.GetFullPath() );
if( m_headless )
{
// Special case namely for cli
// Ensure the settings directory at least exists to prevent additional loading errors from subdirectories
// TODO review headless (unit tests) vs cli needs, this should be fine for unit tests though
if( !path.DirExists() )
{
wxLogTrace( traceSettings, wxT( "Path didn't exist; creating it" ) );
path.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
}
wxLogTrace( traceSettings, wxT( "Settings migration not checked; running headless" ) );
return true;
}
wxFileName path( GetUserSettingsPath(), wxS( "" ) );
wxLogTrace( traceSettings, wxT( "Using settings path %s" ), path.GetFullPath() );
if( path.DirExists() )
{
wxFileName common = path;