dotfiles/Makefile

49 lines
1.2 KiB
Makefile
Raw Normal View History

2022-09-02 16:05:16 -05:00
## lint | lint.*
2022-09-06 09:03:24 -05:00
.PHONY: lint
2022-08-01 16:34:13 -05:00
lint: lint.py lint.sh
2022-10-06 10:53:31 -05:00
msg = $(if tprint,$(call tprint,{a.b_magenta}==>{a.end}{a.bold} $(1){a.end}),@echo '==> $(1)')
2022-09-08 12:53:55 -05:00
2022-09-07 09:16:31 -05:00
## lint.py | lint python files
.PHONY: lint.py
2022-09-08 12:53:55 -05:00
lint.py: info
$(call msg,Linting Python Files)
@black $(shell find -type f -name "*.py")
2022-09-02 16:05:16 -05:00
## lint.sh | lint shell files
2022-09-06 09:03:24 -05:00
.PHONY: lint.sh
2022-08-01 16:34:13 -05:00
lint.sh:
2022-09-08 12:53:55 -05:00
$(call msg,Linting Shell Files)
@shfmt -s -w $(shell shfmt -f .)
2022-10-06 10:53:31 -05:00
## completions | generate completion scripts
completions:
$(call msg,Generating Completions)
@./lib/completions/update.sh
2022-09-02 16:05:16 -05:00
## db, d-build | build docker image
2022-09-06 09:03:24 -05:00
.PHONY: db d-build
2022-09-02 16:05:16 -05:00
db d-build:
2022-09-08 12:53:55 -05:00
$(call msg,Building Docker Image)
2022-12-09 14:25:06 -06:00
@DOCKER_BUILDKIT=1 docker build \
--secret id=GITHUB_TOKEN \
-f docker/Dockerfile \
-t dots .
2022-09-02 16:05:16 -05:00
## dr, d-run | run docker image
2022-09-06 09:03:24 -05:00
.PHONY: dr d-run
2022-09-02 16:05:16 -05:00
dr d-run:
2022-09-08 12:53:55 -05:00
$(call msg,Running Docker Image)
2022-09-02 16:05:16 -05:00
docker run --rm -it dots
.PHONY: dr-keep
dr-keep:
docker run -it dots
2022-09-05 23:49:15 -05:00
.DEFAULT_GOAL = help
2022-09-19 00:21:45 -05:00
GOAL_STYLE = b_magenta
HELP_SEP = {a.b_green}->>{a.end}
2022-09-08 12:53:55 -05:00
USAGE = {a.italic}{a.b_cyan}Best Dots Around{a.end}\n
2022-09-02 16:05:16 -05:00
-include .task.mk
2022-09-14 16:21:25 -05:00
$(if $(wildcard .task.mk),,.task.mk: ; @curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk 2>/dev/null || echo "no curl, skipping task.mk download")