striker-collect-debug: create output dir only when necessary

Signed-off-by: Fabio M. Di Nitto <fabbione@fabbione.net>
main
Fabio M. Di Nitto 9 months ago
parent da67156ee1
commit 3b018e56c6
  1. 22
      tools/striker-collect-debug

@ -155,14 +155,22 @@ sub process_output
if ($output_directory ne "/") if ($output_directory ne "/")
{ {
print "- Creating the output directory: [".$output_directory."]... "; print "Preparing local machine\n";
my $failed = $anvil->Storage->make_directory({directory => $output_directory}); if (! -d $output_directory) {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { failed => $failed }}); print "- Creating the output directory: [".$output_directory."]... ";
if ($failed) my $failed = $anvil->Storage->make_directory({directory => $output_directory});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { failed => $failed }});
if ($failed)
{
print "Failed!\nUnable to create the directory: [".$anvil->data->{sys}{compile_directory}."]. The error should be logged.\n";
$anvil->nice_exit({exit_code => 1});
}
print "Done!\n";
}
else
{ {
print "Failed!\nUnable to create the directory: [".$anvil->data->{sys}{compile_directory}."]. The error should be logged.\n"; print "- Output directory [".$output_directory."] already exists.\n";
$anvil->nice_exit({exit_code => 1}); }
}
} }
$tarball = $output_directory."/".$output_file; $tarball = $output_directory."/".$output_file;

Loading…
Cancel
Save