Skip to content

Commit

Permalink
fixes #27 return status code only upto 126
Browse files Browse the repository at this point in the history
  • Loading branch information
kdabir committed Nov 16, 2018
1 parent 27a6b24 commit 79f3eb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .hastest.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@
[[ "$(echo "${output}" | grep "" | grep "foobar")" ]]
[[ "$(echo "${output}" | grep "" | grep "barbaz")" ]]
}

@test "status code reflects number of failed commands upto 126" {
run bash has $(for i in {1..256}; do echo foo; done)

[[ "$status" -eq 126 ]]
}
10 changes: 7 additions & 3 deletions has
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ else
__detect $cmd
done

# echo ${OK} / $(($OK+$KO))
exit "${KO}"
fi
# echo ${OK} / $(($OK+$KO))
if [[ "$KO" -gt "126" ]]; then
exit "126"
else
exit "${KO}"
fi

fi

0 comments on commit 79f3eb8

Please sign in to comment.