From e14970c8e682e2353fab5229dce732fb8173751b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 13 Jun 2023 08:28:09 +0100 Subject: [PATCH] Fixes to Makefile logic --- Makefile | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 669852e..a7acaee 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,13 @@ BIN_DIR := $(HOME)/.local/bin FONTS_DIR := $(HOME)/.fonts -.PHONY: default clean nvim firacode cspell +.PHONY: default clean nvim -default: nvim firacode cspell +default: $(HOME)/.cspell.json + command -v nvim > /dev/null || make nvim + +$(HOME)/.cspell.json: + -ln -s $$(readlink -f .cspell.json) $@ clean: -rm -rf $(HOME)/.local/share/nvim @@ -13,37 +17,23 @@ clean: -rm -rf $(FONTS_DIR)/FiraCode -rm $(HOME)/.cspell.json -nvim: $(BIN_DIR) - command -v nvim > /dev/null && exit 0 +nvim: $(BIN_DIR)/nvim $(HOME)/.cspell.json $(FONTS_DIR)/FiraCode + +$(BIN_DIR)/nvim: curl -sSLO https://github.com/neovim/neovim/releases/download/stable/nvim.appimage curl -sSLO https://github.com/neovim/neovim/releases/download/stable/nvim.appimage.sha256sum - sha256sum -c nvim.appimage.sha256sum || { - rm nvim.appimage nvim.appimage.sha256sum - exit 1 - } + sha256sum -c nvim.appimage.sha256sum || rm nvim.appimage nvim.appimage.sha256sum + sha256sum -c nvim.appimage.sha256sum || exit 1 rm nvim.appimage.sha256sum chmod a+x nvim.appimage - mv nvim.appimage $(HOME)/.local/bin/nvim + mv nvim.appimage $(BIN_DIR)/nvim -# direnv: $(BIN_DIR) -# bin_path="$(BIN_DIR)" ./installers/direnv.sh - -firacode: $(FONTS_DIR)/ - -firacode: $(FONTS_DIR) - command -v fc-cache > /dev/null || exit 1 - command -v fc-list > /dev/null || exit 1 +$(FONTS_DIR)/FiraCode: fc-list | grep -iE "(fira.*code)*(nerd.*font)" > /dev/null && exit 0 mkdir -p $(FONTS_DIR) && cd $(FONTS_DIR) curl -sSLO https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.0/FiraCode.zip unzip FiraCode.zip -d FiraCode rm FiraCode.zip - fc-cache - -cspell: $(HOME)/.cspell.json - -$(HOME)/.cspell.json: - -ln -s $$(readlink -f .cspell.json) $@ $(BIN_DIR) $(FONTS_DIR): mkdir -p $@