Skip to content

Commit

Permalink
TravisCI: fix issue with single error being ignored.
Browse files Browse the repository at this point in the history
When codestyle check produces single error message, `$num_errors`
remains zero due to lack of newline symbol in the end of error message.
`echo -n` was used to get zero value for empty line, but unfortunately
it affects non-empty line as well.

Now we simply check if there anything in the `$errors` variable.
  • Loading branch information
mgolosova committed Apr 13, 2018
1 parent acd4329 commit 21414b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ jobs:

script:
- errors=`find . -name "*.py" -exec pycodestyle --ignore W503,W292 {} \; `
- num_errors=`echo -n "$errors" | wc -l`
- |
if [ $num_errors -eq 0 ]; then
if [ -z "$errors" ]; then
true
else
echo "$errors"
Expand Down

0 comments on commit 21414b9

Please sign in to comment.