Closed mattie47 closed 2 weeks ago
If you want a failure in your custom phase script to stop sdm, just use
logtobothex "Failure description. Exiting"
logtobothex
does a logtoboth
and then exits with a failure status (1).
Does this do what you want?
New day, closer look. For completeness, will update sdm-phase0 and sdm-phase1 to properly fail if custom phase script exits with fail status.
I've pushed an update for this. Please test and LMK if this resolves the issue for you. Thx
Amazing! Thank you for doing that @gitbls !
Have verified today and can confirm the added || exit
is working as desired.
Will close the issue.
Hi @gitbls,
I see from https://github.com/gitbls/sdm/issues/125 that functionality was implemented in V10.0 (diff here to
runplugins "$theseplugins" $phase || exit
on non-zero return codes.Am I correct in that this won't work currently with custom scripts?
I see there's validation when trying to run a custom script:
However within the functions for running custom scripts with phase 0 and 1, I don't see any check on non-zero?
Is that intentional, or possibly an oversight?
We were trying to add some validation to our custom script so that if something fails, it should stop the entire SDM build.
Instead, right now if a failure /non-zero occurs:
As a very cut down example:
Thanks,
Matt