PLUGIN_FILE={{ plugin_name }}.plugin.zsh
FUNCTIONS=$(wildcard functions/*)
MODULES=$(wildcard modules/*.zsh)
SOURCES=$(PLUGIN_FILE){% if add_bash_wrapper %} {{ plugin_name }}.bash{% endif %} $(MODULES){% if include_functions_dir %} $(FUNCTIONS){% endif %}
{% if include_shell_spec %}TEST_SOURCES=spec/{{ plugin_name }}_spec.sh spec/spec_helper.sh{% endif -%}
all: check test doc
check:{% if include_shell_check %} check_sources{% endif %}{% if include_shell_spec %} check_test_sources{% endif %}
{% if include_shell_check -%}
check_sources: $(SOURCES)
shellcheck --check-sourced --color=auto --shell=bash $^
{% endif %}
{% if include_shell_spec -%}
check_test_sources: $(TEST_SOURCES)
shellspec --syntax-check
test: $(SOURCES) $(TEST_SOURCES)
shellspec --shell /opt/homebrew/bin/zsh --format documentation --output junit
shellspec --shell /opt/homebrew/bin/bash --format documentation --output junit
coverage: $(SOURCES) $(TEST_SOURCES)
shellspec --kcov --kcov-options "--include-pattern=.sh,.bash,.zsh"
{% endif %}
{% if include_shell_doc -%}
DOC_CMD=./mkdoc.zsh
DOC_DIR=doc
DOC_SOURCES=$(PLUGIN_FILE) $(MODULES)
$(DOC_DIR):
mkdir -p $(DOC_DIR)
shdoc: $(DOC_SOURCES) $(DOC_DIR)
$(DOC_CMD)
{% endif %}