update function

This commit is contained in:
2025-02-04 19:33:27 +01:00
parent 5fc6a2cc3b
commit 3e3031ee27
5 changed files with 38 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
function Apply(){
ExitError=$1
shift
Step=$1
shift
Txt=$1
shift
Cmd=$@
eval $@
GetRes=$?
if [[ $GetRes -ne 0 ]] && [[ ExitError -eq 1 ]]
then
echo "Fatal Error on step ${Step} : $Cmd"
exit 10
else
[[ $GetRes -ne 0 ]] && echo "WARNING on step ${Step}" || true
fi
}
# Export de la fonction pour être pris en compte dans les sous shell
export -f Apply