mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Add missing ensure paths called for gerbers job
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19653
This commit is contained in:
parent
3a5eeef9df
commit
b1eaa52e08
@ -927,6 +927,14 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob )
|
|||||||
if( !brd )
|
if( !brd )
|
||||||
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
|
return CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE;
|
||||||
|
|
||||||
|
wxString outPath = aGerberJob->GetFullOutputPath( brd->GetProject() );
|
||||||
|
|
||||||
|
if( !PATHS::EnsurePathExists( outPath, false ) )
|
||||||
|
{
|
||||||
|
m_reporter->Report( _( "Failed to create output directory\n" ), RPT_SEVERITY_ERROR );
|
||||||
|
return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT;
|
||||||
|
}
|
||||||
|
|
||||||
aJob->SetTitleBlock( brd->GetTitleBlock() );
|
aJob->SetTitleBlock( brd->GetTitleBlock() );
|
||||||
loadOverrideDrawingSheet( brd, aGerberJob->m_drawingSheet );
|
loadOverrideDrawingSheet( brd, aGerberJob->m_drawingSheet );
|
||||||
brd->GetProject()->ApplyTextVars( aJob->GetVarOverrides() );
|
brd->GetProject()->ApplyTextVars( aJob->GetVarOverrides() );
|
||||||
@ -996,8 +1004,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob )
|
|||||||
else
|
else
|
||||||
fileExt = FILEEXT::GerberFileExtension;
|
fileExt = FILEEXT::GerberFileExtension;
|
||||||
|
|
||||||
BuildPlotFileName( &fn, aGerberJob->GetFullOutputPath( brd->GetProject() ), layerName,
|
BuildPlotFileName( &fn, outPath, layerName, fileExt );
|
||||||
fileExt );
|
|
||||||
wxString fullname = fn.GetFullName();
|
wxString fullname = fn.GetFullName();
|
||||||
|
|
||||||
jobfile_writer.AddGbrFile( layer, fullname );
|
jobfile_writer.AddGbrFile( layer, fullname );
|
||||||
@ -1041,8 +1048,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob )
|
|||||||
wxFileName fn( brd->GetFileName() );
|
wxFileName fn( brd->GetFileName() );
|
||||||
|
|
||||||
// Build gerber job file from basename
|
// Build gerber job file from basename
|
||||||
BuildPlotFileName( &fn, aGerberJob->GetFullOutputPath( brd->GetProject() ), wxT( "job" ),
|
BuildPlotFileName( &fn, outPath, wxT( "job" ), FILEEXT::GerberJobFileExtension );
|
||||||
FILEEXT::GerberJobFileExtension );
|
|
||||||
jobfile_writer.CreateJobFile( fn.GetFullPath() );
|
jobfile_writer.CreateJobFile( fn.GetFullPath() );
|
||||||
|
|
||||||
return exitCode;
|
return exitCode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user