From dcd86789e7d0b189a8a6e1e620b4e74c164ba37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Dubas?= Date: Sat, 10 Feb 2024 22:28:29 +0000 Subject: [PATCH] feat: make iteasier to create/apply patch file for kickstart.nvim's init.lua (#27) Add Makefile with the operations to fetch and apply patches to kickstart.nvim. Reviewed-on: https://gitea.dubas.dev/joao.dubas/ide/pulls/27 --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3aaea92 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +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: 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) + +.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}'