@@ -482,7 +482,7 @@ runcpp2::StartPipeline( const std::string& scriptPath,
482482 const std::vector<std::string>& runArgs,
483483 const Data::ScriptInfo* lastScriptInfo,
484484 Data::ScriptInfo& outScriptInfo,
485- const std::string& outputDir ,
485+ const std::string& buildOutputDir ,
486486 int & returnStatus)
487487{
488488 INTERNAL_RUNCPP2_SAFE_START ();
@@ -977,33 +977,39 @@ runcpp2::StartPipeline( const std::string& scriptPath,
977977 }
978978 else
979979 {
980+ std::error_code e;
981+
980982 // Copy the output file
981- ghc::filesystem::path destFile = ghc::filesystem::path (outputDir) / target.filename ();
982- std::error_code ec;
983- ghc::filesystem::copy ( target, destFile,
984- ghc::filesystem::copy_options::overwrite_existing, ec);
985- if (ec)
986983 {
987- ssLOG_ERROR (" Failed to copy output file: " << ec.message ());
988- return PipelineResult::UNEXPECTED_FAILURE;
984+ ghc::filesystem::path destFile =
985+ ghc::filesystem::path (buildOutputDir) / target.filename ();
986+
987+ ghc::filesystem::copy ( target, destFile,
988+ ghc::filesystem::copy_options::overwrite_existing, e);
989+ if (e)
990+ {
991+ ssLOG_ERROR (" Failed to copy output file: " << e.message ());
992+ return PipelineResult::UNEXPECTED_FAILURE;
993+ }
989994 }
990995
991996 // Copy the files that need to be copied
992997 for (int i = 0 ; i < filesToCopyPaths.size (); ++i)
993998 {
994999 ghc::filesystem::path srcFile (filesToCopyPaths.at (i));
9951000 ghc::filesystem::path destFile =
996- ghc::filesystem::path (outputDir ) / srcFile.filename ();
1001+ ghc::filesystem::path (buildOutputDir ) / srcFile.filename ();
9971002 ghc::filesystem::copy ( srcFile, destFile,
998- ghc::filesystem::copy_options::overwrite_existing, ec );
999- if (ec )
1003+ ghc::filesystem::copy_options::overwrite_existing, e );
1004+ if (e )
10001005 {
1001- ssLOG_ERROR (" Failed to copy file " << filesToCopyPaths.at (i) << " : " << ec.message ());
1006+ ssLOG_ERROR (" Failed to copy file " << filesToCopyPaths.at (i) << " : " <<
1007+ e.message ());
10021008 return PipelineResult::UNEXPECTED_FAILURE;
10031009 }
10041010 }
10051011
1006- ssLOG_INFO (" Build completed. Files copied to " << outputDir );
1012+ ssLOG_INFO (" Build completed. Files copied to " << buildOutputDir );
10071013 return PipelineResult::SUCCESS;
10081014 }
10091015 }
0 commit comments