mise-action/scripts/test.sh
Mael f0b1d70eae
feat: export env vars from mise.toml (#241)
Solve https://github.com/jdx/mise-action/issues/36

BREAKING CHANGE: we're defaulting this behavior to `true`

---------

Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
2025-08-18 16:33:13 +00:00

21 lines
521 B
Bash
Executable file

#!/usr/bin/env bash
set -euxo pipefail
function assert_equal() {
if [ "$1" != "$2" ]; then
echo "Assertion failed: Expected '$1', got '$2'" >&2
return 1
fi
}
EXPECTED_OUTPUT="jq-1.7.1"
assert_equal "$EXPECTED_OUTPUT" "$(mise exec -- jq --version)"
which jq
# windows bash does not seem to work with shims
if [[ "$(uname)" != "MINGW"* ]]; then
assert_equal "$EXPECTED_OUTPUT" "$(jq --version)"
fi
# checking that environment variables set in mise.toml are properly set
assert_equal "${MY_ENV_VAR}" "abc"