-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (28 loc) · 796 Bytes
/
Makefile
File metadata and controls
37 lines (28 loc) · 796 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
30
31
32
33
34
35
36
37
BIN := dotular
CMD := ./cmd/dotular
.PHONY: build run tidy clean index
build:
go build -o ./build/$(BIN) $(CMD)
run:
go run $(CMD) $(ARGS)
tidy:
go mod tidy
clean:
rm -f ./build/$(BIN)
# Quick smoke tests (uses --dry-run so nothing is mutated)
test-list:
go run $(CMD) list
test-status:
go run $(CMD) status
test-apply-dry:
go run $(CMD) apply --dry-run
index:
@echo "modules:" > modules/index.yaml
@for f in modules/*.yaml; do \
[ "$$(basename "$$f")" = "index.yaml" ] && continue; \
name=$$(grep '^name:' "$$f" | head -1 | sed 's/^name: *//'); \
version=$$(grep '^version:' "$$f" | head -1 | sed 's/^version: *//'); \
echo " - name: $$name" >> modules/index.yaml; \
echo " version: $$version" >> modules/index.yaml; \
done
@echo "Generated modules/index.yaml"