add completion generation to makefile

This commit is contained in:
Daylin Morgan 2022-10-06 10:53:31 -05:00
parent 2c0c3320ee
commit 50d64368f9
2 changed files with 9 additions and 2 deletions

View file

@ -2,7 +2,7 @@
.PHONY: lint
lint: lint.py lint.sh
msg = $(call tprint,{a.b_magenta}==>{a.end}{a.bold} $(1){a.end})
msg = $(if tprint,$(call tprint,{a.b_magenta}==>{a.end}{a.bold} $(1){a.end}),@echo '==> $(1)')
## lint.py | lint python files
.PHONY: lint.py
@ -16,6 +16,11 @@ lint.sh:
$(call msg,Linting Shell Files)
@shfmt -s -w $(shell shfmt -f .)
## completions | generate completion scripts
completions:
$(call msg,Generating Completions)
@./lib/completions/update.sh
## db, d-build | build docker image
.PHONY: db d-build
db d-build:

View file

@ -1,9 +1,11 @@
#!/usr/bin/env zsh
CURDIR=${0:a:h}
gen() {
if is-executable $1; then
echo "$1 updated"
"$@" | sed "s#$HOME#\$HOME#g" >"_$argv[1]"
"$@" | sed "s#$HOME#\$HOME#g" > $CURDIR/"_$argv[1]"
else
echo "skipping $1"
fi