Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Allow loading files that don't end in .bash #201

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libexec/bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -ex

version() {
echo "Bats 0.4.0"
Expand Down
7 changes: 5 additions & 2 deletions libexec/bats-exec-test
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ load() {

if [ "${name:0:1}" = "/" ]; then
filename="${name}"
else
filename="$BATS_TEST_DIRNAME/${name}.bash"
else if [ -f "$BATS_TEST_DIRNAME/${name}" ] ; then
filename="$BATS_TEST_DIRNAME/${name}"
else
filename="$BATS_TEST_DIRNAME/${name}.bash"
fi
fi

[ -f "$filename" ] || {
Expand Down