diff --git a/script/gitlabci/print_env.sh b/script/gitlabci/print_env.sh index 7972fba148e..a358b9f7623 100755 --- a/script/gitlabci/print_env.sh +++ b/script/gitlabci/print_env.sh @@ -45,9 +45,11 @@ echo "${CI_RUNNER_TAGS}" # take all env variables, filter it and display it with a `export` prefix env_name_prefixes=("^ALPAKA_*" "^alpaka_*" "^CMAKE_*" "^BOOST_*" "^CUDA_*") for reg in ${env_name_prefixes[@]}; do - printenv | grep -E ${reg} | while read -r line ; do - echo "export $line \\" - done + if printenv | grep -qE ${reg}; then + printenv | grep -E ${reg} | while read -r line ; do + echo "export $line \\" + done + fi done echo "export CI_RUNNER_TAGS='${CI_RUNNER_TAGS}' \\"