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. 20
      tools/striker-collect-debug

@ -155,13 +155,21 @@ sub process_output
if ($output_directory ne "/")
{
print "- Creating the output directory: [".$output_directory."]... ";
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 "Preparing local machine\n";
if (! -d $output_directory) {
print "- Creating the output directory: [".$output_directory."]... ";
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";
$anvil->nice_exit({exit_code => 1});
print "- Output directory [".$output_directory."] already exists.\n";
}
}

Loading…
Cancel
Save