Commit Graph

11 Commits

Author SHA1 Message Date
Colin Dean
4c15cfb275 fix: correct to inherit_errexit in hledger-bar
I misread something and apparently whatever test I used didn't fail because what's there now is not valid at all.
2024-02-17 20:54:30 -10:00
Colin Dean
4faa381ccd fix: Run shellcheck on hledger-bar
I [encountered][1] an unexpected error when testing hledger-bar for
proposed inclusion in Homebrew's default installation of hledger:

    /opt/homebrew/Cellar/hledger/1.32.2_1/bin/hledger-bar: line 81:
    conditional binary operator expected

I'm doubt that this is fixed by running shellcheck, but checking
a script against shellcheck is usually one of the first things I check
before debugging shell!

This patch is ~generated by shellcheck with

    shellcheck --shell=bash --enable=all --format=diff bin/hledger-bar | \
    git apply

plus some extra, manual additions in the form of a shellcheck directive
to accept something that's a little abnormal for shellcheck but fine
here. The `set -o inherit_exit` was also recommended by shellcheck.

[1]: https://github.com/Homebrew/homebrew-core/actions/runs/7606843601/job/20713321881?pr=160590
2024-01-22 18:16:47 -10:00
Simon Michael
bd8bd393f2 ;fix:hledger-bar: really fix the error when NO_COLOR is not defined [#2159]
Also, it's now more compliant with the no-color.org spec:

  Command-line software which adds ANSI color to its output by default
  should check for a NO_COLOR environment variable that, when present
  and not an empty string (regardless of its value), prevents the
  addition of ANSI color.

so one can now temporarily override $NO_COLOR=1 in the environment by
setting it empty: NO_COLOR= hledger ...
2024-01-22 12:40:48 -10:00
Simon Michael
0f30316cfd ;bin:hledger-bar: fix an error when NO_COLOR is not defined [#2159] 2024-01-22 11:28:13 -10:00
Simon Michael
d8addd5926 ;bin:hledger-bar: fix a shellcheck warning 2024-01-22 10:29:47 -10:00
Simon Michael
32d9deb3e1 ;bin:bar: cleanup 2023-11-21 09:27:26 -10:00
Simon Michael
5e55258e59 ;bin: bar: help tweak 2023-05-23 17:14:47 -10:00
Simon Michael
705c1bec93 ;fix: hledger-bar: detect non-interactive output properly for ANSI 2023-05-09 11:30:46 -10:00
Simon Michael
c5b2465fb0 ;imp: hledger-bar: disable ANSI if terminal is non-interactive 2023-05-06 16:25:51 -10:00
Simon Michael
eba95fb38b ;bin: bar: cleanups 2023-04-20 14:44:29 -10:00
Simon Michael
3165d4d897 bin: hledger-bar - simple bar charts in the terminal 2023-04-20 12:58:08 -10:00