Skip to content

Commit

Permalink
no bug - Updated entrypoint.pl to better handle output and error capture
Browse files Browse the repository at this point in the history
  • Loading branch information
dklawren committed May 15, 2023
1 parent e1825d8 commit 5a8ed8e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/entrypoint.pl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sub cmd_demo {
CONDUIT_USER_PASSWORD
CONDUIT_USER_API_KEY
));
run('perl', 'scripts/generate_conduit_data.pl');
run_quiet('perl', 'scripts/generate_conduit_data.pl');
cmd_httpd();
}

Expand Down Expand Up @@ -115,8 +115,8 @@ sub cmd_selenium_dev {
sub cmd_dev_httpd {
assert_database->get();

run('perl', 'checksetup.pl', '--no-template', $ENV{BZ_ANSWERS_FILE});
run(
run_quiet('perl', 'checksetup.pl', '--no-template', $ENV{BZ_ANSWERS_FILE});
run_quiet(
'perl', 'scripts/generate_bmo_data.pl',
'--param' => 'use_mailer_queue=0',
'[email protected]'
Expand All @@ -130,7 +130,7 @@ sub cmd_dev_httpd {
sub cmd_checksetup {
check_data_dir();
wait_for_db();
run('perl', 'checksetup.pl', '--no-template', '--no-permissions');
run_quiet('perl', 'checksetup.pl', '--no-template', '--no-permissions');
}

sub cmd_load_test_data {
Expand Down Expand Up @@ -307,8 +307,10 @@ sub run {
sub run_quiet {
my (@cmd) = @_;
say "+ @cmd";
my ($out, $err) = capture {
run(@cmd);
};
die "$out\n$err" if $err;
my ($output, $error, $rv) = capture { system @cmd; };
if ($rv != 0) {
say "$output\n$error";
exit $rv;
}
}

0 comments on commit 5a8ed8e

Please sign in to comment.