Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (48 loc) · 2.04 KB
/
Copy pathMakefile
File metadata and controls
62 lines (48 loc) · 2.04 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SHELL := /bin/bash
HOST_ARG := $(or $(HOST),$(word 2,$(MAKECMDGOALS)))
ifeq ($(firstword $(MAKECMDGOALS)),setup-linux)
EXTRA_SETUP_LINUX_GOALS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(EXTRA_SETUP_LINUX_GOALS):
@:
endif
MISE ?= mise
MISE_CONFIG := $(CURDIR)/config/mise/config.toml
MISE_RUN := MISE_GLOBAL_CONFIG_FILE=$(MISE_CONFIG) MISE_TRUSTED_CONFIG_PATHS=$(MISE_CONFIG) MISE_TASK_RUN_AUTO_INSTALL=false $(MISE)
LUA_FILES := config/nvim
SHFMT_FILES := config/zsh/*.zsh home/.zshrc home/.p10k.mise.zsh home/.p10k.zsh local/bin/tmux-sesh
TOML_FILES := '**/*.toml'
.PHONY: help install setup setup-linux tools test update-all dev-update fmt lint mise-tasks
help:
@printf 'Targets:\n'
@printf ' install Install mise tools, then apply dotfiles\n'
@printf ' setup Apply dotfiles\n'
@printf ' setup-linux Bootstrap a remote Linux host (HOST=user@host or make setup-linux user@host)\n'
@printf ' tools Install mise-managed tools\n'
@printf ' test Run TOML, shell, mise, and Neovim checks\n'
@printf ' update-all Update Homebrew (all casks), mise, and mise-managed tools\n'
@printf ' fmt Format TOML and shell files\n'
@printf ' lint Run format/lint checks only\n'
install: tools setup
setup:
$(MISE_RUN) run setup
setup-linux:
@test -n "$(HOST_ARG)" || (echo "usage: make setup-linux HOST=user@host"; echo " or: make setup-linux user@host"; exit 1)
$(MAKE) -C bootstrap setup-linux HOST="$(HOST_ARG)"
tools:
$(MISE_RUN) install
test: lint
$(MISE_RUN) run test
update-all:
$(MISE_RUN) run update-all
dev-update: update-all
fmt:
$(MISE_RUN) exec stylua -- stylua $(LUA_FILES)
$(MISE_RUN) exec taplo -- taplo format --config taplo.toml $(TOML_FILES)
$(MISE_RUN) exec shfmt -- shfmt -w $(SHFMT_FILES)
lint:
$(MISE_RUN) exec stylua -- stylua --check $(LUA_FILES)
$(MISE_RUN) exec taplo -- taplo format --config taplo.toml --check $(TOML_FILES)
$(MISE_RUN) exec taplo -- taplo lint --config taplo.toml $(TOML_FILES)
$(MISE_RUN) exec shfmt -- shfmt -d $(SHFMT_FILES)
mise-tasks:
$(MISE_RUN) tasks