Skip to content
RED SAGSkills
hard20 pts · first answer countsshell-scriptingci-cd

set -e does not stop the script

This script runs with set -euo pipefail, yet when fetch_token fails the script keeps going and deploys with an empty token. Why?

set -euo pipefail

get_token() {
  local token=$(fetch_token)
  echo "$token"
}

TOKEN=$(get_token)
./deploy.sh --token "$TOKEN"
Choose one answer