Skip to content

Commit

Permalink
Add realpath polyfill for Trusty and Precise on Travis #31
Browse files Browse the repository at this point in the history
  • Loading branch information
dharple committed Feb 13, 2021
1 parent 07df16c commit 97367db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/test-functions
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
# unit test functions
#

##
# Realpath polyfill for systems where it doesn't exist
#
# @param $1 Path to examine
#
if [ ! -x "$(command -v realpath)" ] ; then
function realpath()
{
readlink -f $1
}
fi

##
# Executes a single test against a single function using a single table.
#
Expand Down
4 changes: 3 additions & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ if [ -z $1 ] ; then
exit 1
fi

. $(dirname $0)/test-functions

DETOX=$(realpath $1)
if [ ! -x $DETOX ] ; then
if [ ! -x "$DETOX" ] ; then
echo cannot find detox at $1
exit 1
fi
Expand Down

0 comments on commit 97367db

Please sign in to comment.