Skip to content

Commit 847d2ba

Browse files
committed
fix(mise-tasks): handle unset CI variable in test script
Add missing check for unset CI environment variable in the is-in-ci function. The function now returns false immediately when CI is unset, preventing errors in the case statement when converting an unset variable to lowercase. This ensures the script handles both unset and false CI values consistently without errors.
1 parent 007105e commit 847d2ba

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • template/.config/copier/mise-tasks

template/.config/copier/mise-tasks/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ set -o nounset
66
set -o pipefail
77

88
function is-in-ci() {
9+
if [[ -z ${CI:-} ]]; then
10+
return 1
11+
fi
912
case "${CI,,}" in
1013
1 | on | true | y | yes) return 0 ;;
1114
0 | off | false | n | no | "") return 1 ;;

0 commit comments

Comments
 (0)