From ee4033af821f73b7ca0ef698e5e059b5bf5bdc48 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 5 May 2023 15:17:02 +0100 Subject: [PATCH] Add nvim installer script Add clean up for legacy style install --- Makefile | 12 ++++++++++-- scripts/installers/nvim.sh | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 scripts/installers/nvim.sh diff --git a/Makefile b/Makefile index 1742d3f2..e2e85885 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config) BIN_DIR := $(HOME)/.local/bin HOMEMANAGER_CONFIG_DIR := $(CONFIG_DIR)/home-manager -.PHONY: default all clean nixos home legacy +.PHONY: default all clean nixos home legacy lclean default: [ -e /etc/nixos/ ] && make nixos || make home @@ -39,6 +39,14 @@ legacy: $(CONFIG_DIR) $(BIN_DIR) fc-list | grep -iE "(fira.*code)*(nerd.*font)" > /dev/null || ./scripts/installers/firacode.sh && fc-cache command -v nvim > /dev/null || ./scripts/installers/nvim.sh [ -e $(CONFIG_DIR)/nvim ] || ln -s $(PWD)/home/tui/config/nvim $(CONFIG_DIR)/ - command -v starship > /dev/null || ./scripts/installers/starship.sh --yes --bin-dir $(HOME)/.local/bin + command -v starship > /dev/null || ./scripts/installers/starship.sh --yes --bin-dir $(BIN_DIR) [ -e $(CONFIG_DIR)/starship.toml ] || ln -s $(PWD)/home/env/config/starship.toml $(CONFIG_DIR)/ command -v direnv > /dev/null || bin_path="$(BIN_DIR)" ./scripts/installers/direnv.sh + +lclean: clean + [ -e $(HOME)/.fonts/FiraCode ] && rm -rf $(HOME)/.fonts/FiraCode + [ -e $(BIN_DIR)/nvim ] && rm $(BIN_DIR)/nvim + [ -e $(CONFIG_DIR)/nvim ] && rm $(CONFIG_DIR)/nvim + [ -e $(BIN_DIR)/starship ] && rm $(BIN_DIR)/starship + [ -e $(CONFIG_DIR)/starship.toml ] && rm $(CONFIG_DIR)/starship.toml + [ -e $(BIN_DIR)/direnv ] && rm $(BIN_DIR)/direnv diff --git a/scripts/installers/nvim.sh b/scripts/installers/nvim.sh new file mode 100755 index 00000000..a2249e36 --- /dev/null +++ b/scripts/installers/nvim.sh @@ -0,0 +1,8 @@ +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 +} +chmod a+x nvim.appimage +mv nvim.appimage $HOME/.local/bin/nvim