mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 10:00:13 +00:00
Handle home dir shortcut in jobset destinations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20032
This commit is contained in:
parent
33a8cd942f
commit
b366204824
@ -35,9 +35,7 @@ JOBS_OUTPUT_ARCHIVE::JOBS_OUTPUT_ARCHIVE() :
|
||||
bool JOBS_OUTPUT_ARCHIVE::OutputPrecheck()
|
||||
{
|
||||
if( m_outputPath.IsEmpty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -51,6 +49,9 @@ bool JOBS_OUTPUT_ARCHIVE::HandleOutputs( const wxString& baseTempPath, PROJECT*
|
||||
wxString outputPath = ExpandTextVars( m_outputPath, aProject );
|
||||
outputPath = ExpandEnvVarSubstitutions( outputPath, aProject );
|
||||
|
||||
if( outputPath.StartsWith( "~" ) )
|
||||
outputPath.Replace( "~", wxGetHomeDir(), false );
|
||||
|
||||
wxFFileOutputStream ostream( outputPath );
|
||||
|
||||
if( !ostream.IsOk() ) // issue to create the file. Perhaps not writable dir
|
||||
@ -64,14 +65,10 @@ bool JOBS_OUTPUT_ARCHIVE::HandleOutputs( const wxString& baseTempPath, PROJECT*
|
||||
wxString errors;
|
||||
|
||||
if( !AddDirectoryToZip( zipstream, baseTempPath, errors ) )
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
|
||||
if( !zipstream.Close() )
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
@ -36,33 +36,28 @@ bool JOBS_OUTPUT_FOLDER::HandleOutputs( const wxString& baseTempPath, PROJECT* a
|
||||
wxString outputPath = ExpandTextVars( m_outputPath, aProject );
|
||||
outputPath = ExpandEnvVarSubstitutions( outputPath, aProject );
|
||||
|
||||
if( outputPath.StartsWith( "~" ) )
|
||||
outputPath.Replace( "~", wxGetHomeDir(), false );
|
||||
|
||||
if( !wxFileName::DirExists( outputPath ) )
|
||||
{
|
||||
if( !wxFileName::Mkdir( outputPath, wxS_DIR_DEFAULT ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
||||
wxString errors;
|
||||
|
||||
if( !CopyDirectory( baseTempPath, outputPath, errors ) )
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
return false;
|
||||
|
||||
return success;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool JOBS_OUTPUT_FOLDER::OutputPrecheck()
|
||||
{
|
||||
if( m_outputPath.IsEmpty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user