Copyfiles job needs a cwd (at least on OSX).

Also, don't infinitely recurse when given "*".
This commit is contained in:
Jeff Young 2025-01-04 15:40:47 +00:00
parent ad513345fe
commit fcf546516a
6 changed files with 27 additions and 18 deletions

View File

@ -433,6 +433,10 @@ bool CopyFilesOrDirectory( const wxString& aSourcePath, const wxString& aDestDir
wxString sourcePath = sourceFn.GetPath() + wxFileName::GetPathSeparator() + filename;
wxString destPath = aDestDir + wxFileName::GetPathSeparator() + filename;
// Avoid infinite recursion on "*"
if( sourcePath == aSourcePath )
break;
if( wxFileName::DirExists( sourcePath ) )
{
// Recursively copy subdirectories

View File

@ -238,7 +238,8 @@ public:
m_jobsFile( aJobsFile ),
m_output( aOutput )
{
m_staticTextOutputName->SetLabel( aOutput->m_outputHandler->GetOutputPath() );
m_staticTextOutputName->SetLabel( wxString::Format( _( "Output: %s" ),
aOutput->GetDescription() ) );
int jobBmpColId = m_jobList->AppendColumn( wxT( "" ) );
int jobNoColId = m_jobList->AppendColumn( _( "No." ) );
@ -269,6 +270,8 @@ public:
m_jobList->SetItem( itemIndex, jobNoColId, wxString::Format( "%d", num++ ) );
m_jobList->SetItem( itemIndex, jobDescColId, job.GetDescription() );
}
SetupStandardButtons( { { wxID_OK, _( "Close" ) } } );
}

View File

@ -48,7 +48,7 @@ PANEL_JOBS_BASE::PANEL_JOBS_BASE( wxWindow* parent, wxWindowID id, const wxPoint
// Label Appearance
// Cell Defaults
m_jobsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
m_jobsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbJobs->Add( m_jobsGrid, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 3 );
wxBoxSizer* bJobsButtons;

View File

@ -31,7 +31,7 @@
<property name="relative_path">1</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Panel" expanded="true">
<object class="Panel" expanded="false">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
@ -55,25 +55,25 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizerUpper</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">7</property>
<object class="wxStaticBoxSizer" expanded="true">
<object class="wxStaticBoxSizer" expanded="false">
<property name="id">wxID_ANY</property>
<property name="label">Jobs</property>
<property name="minimum_size"></property>
@ -104,7 +104,7 @@
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
@ -504,11 +504,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">4</property>
<object class="wxStaticBoxSizer" expanded="true">
<object class="wxStaticBoxSizer" expanded="false">
<property name="id">wxID_ANY</property>
<property name="label">Outputs</property>
<property name="minimum_size"></property>
@ -516,11 +516,11 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">0</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxScrolledWindow" expanded="true">
<object class="wxScrolledWindow" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -2016,7 +2016,7 @@
<property name="name">DIALOG_OUTPUT_RUN_RESULTS_BASE</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h; forward_declare</property>
<property name="title">Job Output Run Log</property>
<property name="tooltip"></property>

View File

@ -163,7 +163,7 @@ class DIALOG_OUTPUT_RUN_RESULTS_BASE : public DIALOG_SHIM
public:
DIALOG_OUTPUT_RUN_RESULTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Job Output Run Log"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
DIALOG_OUTPUT_RUN_RESULTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Job Output Run Log"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_OUTPUT_RUN_RESULTS_BASE();

View File

@ -109,13 +109,15 @@ int JOBS_RUNNER::runSpecialCopyFiles( const JOBSET_JOB* aJob, PROJECT* aProject
JOB_SPECIAL_COPYFILES* job = static_cast<JOB_SPECIAL_COPYFILES*>( aJob->m_job.get() );
if( job->m_source.IsEmpty() )
{
return CLI::EXIT_CODES::ERR_ARGS;
}
wxFileName source( job->m_source );
source.MakeAbsolute( aProject->GetProjectPath() );
wxString errors;
int copyCount = 0;
bool success = CopyFilesOrDirectory( job->m_source, job->GetFullOutputPath(), errors, copyCount );
bool success = CopyFilesOrDirectory( source.GetFullPath(), job->GetFullOutputPath(),
errors, copyCount );
if( !success )
return CLI::EXIT_CODES::ERR_UNKNOWN;