Skip to content

Commit

Permalink
Fix nagging warning on regression tests
Browse files Browse the repository at this point in the history
tests/highlight_regression.sh: line 17: CI: unbound variable

This shows up when running tests locally, ever since I added CI.

Relevant Stack Overflow:
https://stackoverflow.com/questions/39296472/how-to-check-if-an-environment-variable-exists-and-get-its-value
  • Loading branch information
victor-gp committed Nov 7, 2022
1 parent ab04bda commit b4f1bc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/highlight_regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ docker run --rm \
-v "$vol1" -v "$vol2" \
bat-test

if [ ! "$CI" ]; then
# if $CI is unset
if [ -z ${CI+x} ]; then
# have git tell the effective difference between the version of the syntax
# in HEAD/staging and the one in working dir, for all highlighted samples
GIT_PAGER='LESS=R less' git diff -- highlighted/
Expand Down
3 changes: 2 additions & 1 deletion tests/theme_regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ docker run --rm \
--entrypoint /tests/inner_theme_regression.sh \
bat-test

if [ ! "$CI" ]; then
# if $CI is unset
if [ -z ${CI+x} ]; then
# effective difference between HEAD/staging and working dir
GIT_PAGER='LESS=R less' git diff -- theme/

Expand Down

0 comments on commit b4f1bc2

Please sign in to comment.