Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Supress errors about file not found
Browse files Browse the repository at this point in the history
When we're waiting for browserstack to start, the log file that is
checked might not exist yet resulting in a "file not found error".

Adding '-s' to grep supress those errors.

One consern though is that if the file is missing because of other
problems, this might be hard to debug.

Maybe there stderr should be redirected to a file so it can be debugged.

Something like:
```
while ! grep -s "${DONE_MSG}" ${BROWSER_STACK_LOG_FILE} 2>
grep_errors.log > /dev/null; do
```
  • Loading branch information
parberge authored and diemol committed Mar 4, 2018
1 parent 2a9002e commit 5d1158f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/wait-browserstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if [ "${BROWSER_STACK_TUNNEL}" = "true" ]; then
echo "Waiting for BrowserStack tunnel to start..."
# Required params
[ -z "${BROWSER_STACK_LOG_FILE}" ] && die "Required env var BROWSER_STACK_LOG_FILE"
while ! grep "${DONE_MSG}" ${BROWSER_STACK_LOG_FILE} >/dev/null; do
while ! grep -s "${DONE_MSG}" ${BROWSER_STACK_LOG_FILE} >/dev/null; do
echo -n '.'
sleep 0.2;
done
echo "BrowserStack tunnel started! (wait-browserstack.sh)"
else
echo "Won't start BrowserStack tunnel due to BROWSER_STACK_TUNNEL false"
fi
fi

0 comments on commit 5d1158f

Please # to comment.