Ensure output directory exists for drill files cli export

This commit is contained in:
Marek Roszko 2023-11-06 21:11:35 -05:00
parent 5f6dab931a
commit 23676eb988
1 changed files with 8 additions and 0 deletions

View File

@ -536,6 +536,14 @@ int PCBNEW_JOBS_HANDLER::JobExportDrill( JOB* aJob )
BOARD* brd = LoadBoard( aDrillJob->m_filename );
// ensure output dir exists
wxFileName fn( aDrillJob->m_outputDir + wxT( "/" ) );
if( !fn.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
{
m_reporter->Report( _( "Failed to create output directory\n" ), RPT_SEVERITY_ERROR );
return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT;
}
std::unique_ptr<GENDRILL_WRITER_BASE> drillWriter;
if( aDrillJob->m_format == JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::EXCELLON )