From 06921d26bcdf129b1885b05d34d5952d68bb97ea Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Thu, 8 Feb 2024 10:12:05 -0300 Subject: [PATCH 1/2] feat: make easier to update kickstart patch --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8cc5bdb --- /dev/null +++ b/Makefile @@ -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}' -- 2.47.2 From ff2c825042eb40b38735a142d70eca5c3509271a Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Thu, 8 Feb 2024 10:37:39 -0300 Subject: [PATCH 2/2] chore: add target to apply patch --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 8cc5bdb..3aaea92 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ neovim_config_dir := $(XDG_CONFIG_HOME)/nvim .DEFAULT_GOAL = help +.PHONY: apply_patch_init_lua +apply_patch_init_lua: ## apply the patch file in kickstart's init.lua file + @cd $(neovim_config_dir) && git apply $(neovim_patch_file) + .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) -- 2.47.2