Skip to content
Snippets Groups Projects
Unverified Commit 33982bea authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

ci: integration: fix assert_exists (MR 54)

If find doesn't turn up any files, then this check was always passing,
which is obviously wrong :)

There's a comment about using find to support globbing, but shell
globing works and using `test -e` is simpler than trying to get `find`
to do what we want.
parent 9397bbc1
No related branches found
No related tags found
No related merge requests found
......@@ -32,13 +32,14 @@ assert_exists() {
echo "ERROR: assert_exists: no argument given"
exit 1
fi
# Use find so we support globbing
if ! find . -wholename "$1" >/dev/null 2>&1; then
echo "ERROR: assert_exists: file not found: $1"
if [ ! -e "$1" ]; then
echo "$1 NOT found"
return
fi
_files="$(find . -wholename "$1")"
# And check it's not empty!
for _file in $_files; do
if [ ! -s "$_file" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment