Browse Source
Fixes mono repo install exit code check
Corrects the mono repo install exit code check to use the dedicated monorepoexitcode variable, ensuring accurate error detection.
Updates the exit trap to preserve the original exit status, preventing potential loss of information when handling script termination.
pull/4854/head
Daniel Gibbs
4 months ago
Failed to extract signature
2 changed files with
6 additions and
4 deletions
lgsm/modules/check_deps.sh
lgsm/modules/core_trap.sh
@ -75,11 +75,11 @@ fn_install_mono_repo() {
# Run the mono repo install.
# Run the mono repo install.
eval " ${ cmd } "
eval " ${ cmd } "
monorepoexitcode = $?
# Did Mono repo install correctly?
# Did Mono repo install correctly?
if [ " ${ monoautoinstall } " != "1" ] ; then
if [ " ${ monoautoinstall } " != "1" ] ; then
exitcode = $?
if [ " ${ monorepoexitcode } " -ne 0 ] ; then
if [ " ${ exitcode } " -ne 0 ] ; then
fn_print_failure_nl "Unable to install Mono repository."
fn_print_failure_nl "Unable to install Mono repository."
fn_script_log_fail "Unable to install Mono repository."
fn_script_log_fail "Unable to install Mono repository."
else
else
@ -8,10 +8,12 @@
moduleselfname = " $( basename " $( readlink -f " ${ BASH_SOURCE [0] } " ) " ) "
moduleselfname = " $( basename " $( readlink -f " ${ BASH_SOURCE [0] } " ) " ) "
fn_exit_trap( ) {
fn_exit_trap( ) {
local saved_exit_status = $?
echo -e ""
if [ -z " ${ exitcode } " ] ; then
if [ -z " ${ exitcode } " ] ; then
exitcode = $?
exitcode = ${ saved_exit_status }
fi
fi
echo -e ""
if [ -z " ${ exitcode } " ] ; then
if [ -z " ${ exitcode } " ] ; then
exitcode = 0
exitcode = 0
fi
fi