I have a shell script that I use on gitlab CI that runs a supplied command. The issue is it doesn't display errors if the command failed, it just says ERROR: Job failed: exit code 1. I tried the script locally and it was able to output the failed command, is there a way I could somehow force it to display the error through my script before it exits the job?
The particular part of my script
output="$( (cd "$FOLDER"; eval "$@") 2>&1 )"
if [ "$output" ]; then
echo -e "$output\n"
fi
output=$(cd "$FOLDER"; eval "$@") || code="$?". Then just did checks on$code. You should do the honors of posting an answer. I could also give you the working code snippet to put on the answer.