-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) Β· 978 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) Β· 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SHELL := /bin/bash
SCRIPTS_DIR := scripts
TESTS_DIR := tests
INSTALL_DIR ?= /usr/local/bin
.PHONY: all test lint install clean help
all: lint test ## Run lint then test (default target)
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
test: ## Run the full BATS test suite
bats $(TESTS_DIR)/*.bats
lint: ## Lint all scripts with ShellCheck
@echo "Running ShellCheck on all scripts..."
@find $(SCRIPTS_DIR)/ -name "*.sh" -type f | sort | xargs shellcheck
@echo "ShellCheck passed."
install: ## Install all scripts to INSTALL_DIR (default: /usr/local/bin)
@chmod 755 $(SCRIPTS_DIR)/*.sh
@cp $(SCRIPTS_DIR)/*.sh $(INSTALL_DIR)/
@echo "Installed $$(ls $(SCRIPTS_DIR)/*.sh | wc -l | tr -d ' ') scripts to $(INSTALL_DIR)"
clean: ## Remove temporary test artefacts
@rm -f /tmp/bats_test_* /tmp/test_*
@echo "Cleaned up test artefacts."