Skip to content

Commit d4b1af4

Browse files
authored
fix: expand paths before checking for existence (#34)
1 parent bbff479 commit d4b1af4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/scripts/coveralls.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@ fi
3333

3434
# Check for coverage file presence
3535
if [ -n "${COVERALLS_COVERAGE_FILE}" ]; then
36-
if [ ! -e "${COVERALLS_COVERAGE_FILE}" ]; then
36+
_COVERALLS_COVERAGE_FILE="$(readlink -f "$COVERALLS_COVERAGE_FILE")"
37+
if [ ! -e "${_COVERALLS_COVERAGE_FILE}" ]; then
3738
echo "Please specify a valid 'coverage_file' parameter. File doesn't exist. Filename: ${COVERALLS_COVERAGE_FILE}"
3839
exit 1
39-
elif [ ! -r "${COVERALLS_COVERAGE_FILE}" ]; then
40+
elif [ ! -r "${_COVERALLS_COVERAGE_FILE}" ]; then
4041
echo "Please specify a valid 'coverage_file' parameter. File is not readable. Filename: ${COVERALLS_COVERAGE_FILE}"
4142
exit 1
42-
elif [ ! -f "${COVERALLS_COVERAGE_FILE}" ]; then
43+
elif [ ! -f "${_COVERALLS_COVERAGE_FILE}" ]; then
4344
echo "Please specify a valid 'coverage_file' parameter. File specified is not a regular file. Filename: ${COVERALLS_COVERAGE_FILE}"
4445
exit 1
45-
else
46-
args="${args} --file ${COVERALLS_COVERAGE_FILE}"
4746
fi
47+
48+
args="${args} --file ${_COVERALLS_COVERAGE_FILE}"
4849
fi
4950

5051
if [ -n "${COVERALLS_BASE_PATH}" ]; then

0 commit comments

Comments
 (0)