Exit build with an error if unable to parse hledger sub-commands
This commit is contained in:
parent
ac143aff6b
commit
62c3c8e6da
@ -27,6 +27,11 @@ EXTENSIONS := ui web
|
|||||||
INSTALLED_EXTENSIONS := $(foreach EXT,$(EXTENSIONS),$(shell type hledger-$(EXT) >/dev/null 2>&1 && echo $(EXT)))
|
INSTALLED_EXTENSIONS := $(foreach EXT,$(EXTENSIONS),$(shell type hledger-$(EXT) >/dev/null 2>&1 && echo $(EXT)))
|
||||||
|
|
||||||
COMMANDS := $(sort $(shell $(PARSE_COMMANDS)) $(INSTALLED_EXTENSIONS))
|
COMMANDS := $(sort $(shell $(PARSE_COMMANDS)) $(INSTALLED_EXTENSIONS))
|
||||||
|
|
||||||
|
ifneq ($(.SHELLSTATUS),0)
|
||||||
|
$(error Error running $(PARSE_COMMANDS))
|
||||||
|
endif
|
||||||
|
|
||||||
CMDOPTFILES := $(foreach CMD,$(COMMANDS),options-$(CMD).txt)
|
CMDOPTFILES := $(foreach CMD,$(COMMANDS),options-$(CMD).txt)
|
||||||
|
|
||||||
all: hledger-completion.bash
|
all: hledger-completion.bash
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
declare commands_help
|
declare commands_help
|
||||||
commands_help=$(hledger)
|
commands_help=$(hledger) || exit
|
||||||
{
|
{
|
||||||
sed -rn 's/^\s+([a-z][-a-z]+)\s+.*/\1/p' <<< "$commands_help"
|
sed -rn 's/^\s+([a-z][-a-z]+)\s+.*/\1/p' <<< "$commands_help"
|
||||||
sed -rn 's/^\s+[a-z][-a-z]+\s+\(([a-z][ ,a-z]+)\).*/\1/p' <<< "$commands_help" |
|
sed -rn 's/^\s+[a-z][-a-z]+\s+\(([a-z][ ,a-z]+)\).*/\1/p' <<< "$commands_help" |
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user