feat: make easier to update kickstart patch

This commit is contained in:
Joao P Dubas 2024-02-08 10:12:05 -03:00
parent b56ca7a358
commit 06921d26bc

17
Makefile Normal file
View File

@ -0,0 +1,17 @@
root_dir := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
neovim_patch_file := $(root_dir)/patch/kickstart.nvim/updates.patch
neovim_config_dir := $(XDG_CONFIG_HOME)/nvim
.DEFAULT_GOAL = help
.PHONY: patch_init_lua
patch_init_lua: ## create a patch file with the changes made in kickstart's init.lua file
@cd $(neovim_config_dir) && git diff --patch init.lua > $(neovim_patch_file)
.PHONY: patch_init_lua_dry_run
patch_init_lua_dry_run: ## show the changes made in kickstart's init.lua file
@cd $(neovim_config_dir) && git --patch init.lua
.PHONY: help
help: ## show help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'