Closed moritzheiber closed 3 years ago
So that's what it is. It seems that td count
returns the value with some additional characters so here's how I worked around it:
ntask=$(td count $FILTER | sed 's/[^0-9]*//g')
COUNT="$(printf ' %-2s' "${ntask: :-1}")"
But your solution is more elegant. Another PR is being merged, can you please wait for a bit till we merge that one then rebase? BWT, thanks for the test, it was needed!
Sure thing, no problem.
We merged that PR, so please rebase.
bash has this weird way of converting numbers with leading zeros to octals, which means that the
todo
blocket will throw an error whenever just a zero is passed into it. This works around it by usingawk
toprintf
the statement.Also added tests to verify the script gives us proper output.