From 21b41688ee8c5056ffbb2b07df141ce1ccb4b213 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:47:58 +0100 Subject: refactor: use a static lvim binary template (#1444) --- Makefile | 12 +++++++---- utils/bin/lvim | 6 ------ utils/bin/lvim.template | 7 +++++++ utils/installer/install.sh | 13 +----------- utils/installer/install_bin.sh | 46 +++++++++++++++++++++++------------------- 5 files changed, 41 insertions(+), 43 deletions(-) delete mode 100644 utils/bin/lvim create mode 100644 utils/bin/lvim.template diff --git a/Makefile b/Makefile index aabe3d53..24d51271 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,19 @@ SHELL := /bin/bash install: - @echo Starting LunarVim Installer + @echo starting LunarVim installer bash ./utils/installer/install.sh +install-bin: + @echo starting LunarVim bin-installer + bash ./utils/installer/install_bin.sh + install-neovim-binary: - @echo Installing Neovim from github releases + @echo installing Neovim from github releases bash ./utils/installer/install-neovim-from-release uninstall: - @echo Starting LunarVim Uninstaller + @echo starting LunarVim uninstaller bash ./utils/installer/uninstall.sh generate_plugins_sha: @@ -30,7 +34,7 @@ style-lua: stylua --config-path .stylua.toml --check . style-sh: - shfmt -f . | grep -v jdtls | xargs shfmt -i 2 -ci -l -d + shfmt -f . | grep -v jdtls | xargs shfmt -i 2 -ci -bn -l -d test: bash ./utils/bin/test_runner.sh "$(TEST)" diff --git a/utils/bin/lvim b/utils/bin/lvim deleted file mode 100644 index e4cd9c75..00000000 --- a/utils/bin/lvim +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-$HOME/.local/share/lunarvim}" -export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-$HOME/.config/lvim}" - -exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@" diff --git a/utils/bin/lvim.template b/utils/bin/lvim.template new file mode 100644 index 00000000..1b18977d --- /dev/null +++ b/utils/bin/lvim.template @@ -0,0 +1,7 @@ +#!/bin/sh + +export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-RUNTIME_DIR_VAR}" +export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-CONFIG_DIR_VAR}" +export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-CACHE_DIR_VAR}" + +exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@" diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 1987a519..c30f2efe 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -352,18 +352,7 @@ function link_local_lvim() { } function setup_shim() { - if [ ! -d "$INSTALL_PREFIX/bin" ]; then - mkdir -p "$INSTALL_PREFIX/bin" - fi - cat >"$INSTALL_PREFIX/bin/lvim" <"$INSTALL_PREFIX/bin/lvim" </dev/null + + chmod u+x "$dst" } setup_shim "$@" + echo "You can start LunarVim by running: $INSTALL_PREFIX/bin/lvim" -- cgit v1.2.3