summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoropalmay <[email protected]>2023-02-17 12:55:42 +0200
committeropalmay <[email protected]>2023-02-24 17:18:10 +0200
commit70d1b429000b8aab8e72d635a59ab8ed4ed50849 (patch)
treef698b730a08b1f5bc9291dfd02dda042d3b3777a
parenteb62a17081b7164128eb5702925bb7757a22ef8d (diff)
refactor: install_bin
-rw-r--r--utils/bin/lvim.template7
-rwxr-xr-xutils/installer/install.sh2
-rwxr-xr-xutils/installer/install_bin.sh20
3 files changed, 9 insertions, 20 deletions
diff --git a/utils/bin/lvim.template b/utils/bin/lvim.template
index c17d25be..af094057 100644
--- a/utils/bin/lvim.template
+++ b/utils/bin/lvim.template
@@ -1,9 +1,6 @@
#!/usr/bin/env bash
-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}"
-
-export LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-BASE_DIR_VAR}"
+export NVIM_APPNAME="${NVIM_APPNAME:-"NVIM_APPNAME_VAR"}"
+export LUNARVIM_BASE_DIR="XDG_DATA_HOME_VAR/$NVIM_APPNAME"
exec -a lvim nvim -u "$LUNARVIM_BASE_DIR/init.lua" "$@"
diff --git a/utils/installer/install.sh b/utils/installer/install.sh
index 7f025443..b7cddac4 100755
--- a/utils/installer/install.sh
+++ b/utils/installer/install.sh
@@ -165,7 +165,7 @@ function main() {
msg "$ADDITIONAL_WARNINGS"
msg "Thank you for installing LunarVim!!"
- echo "You can start it by running: $XDG_DATA_HOME/bin/lvim"
+ echo "You can start it by running: $XDG_DATA_HOME/.local/bin/lvim"
echo "Do not forget to use a font with glyphs (icons) support [https://github.com/ryanoasis/nerd-fonts]"
}
diff --git a/utils/installer/install_bin.sh b/utils/installer/install_bin.sh
index 920f2fd5..e55a2dbf 100755
--- a/utils/installer/install_bin.sh
+++ b/utils/installer/install_bin.sh
@@ -1,17 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail
-INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
-
XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}"
-XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}"
-XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}"
-
-LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}"
-LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}"
-LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}"
-LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}"
+NVIM_APPNAME="${NVIM_APPNAME:-"lvim"}"
+LUNARVIM_DATA_DIR="$XDG_DATA_HOME/$NVIM_APPNAME"
+LUNARVIM_BASE_DIR="$LUNARVIM_DATA_DIR/core"
function setup_shim() {
local src="$LUNARVIM_BASE_DIR/utils/bin/lvim.template"
@@ -24,10 +18,8 @@ function setup_shim() {
cp "$src" "$dst"
- sed -e s"#RUNTIME_DIR_VAR#\"${LUNARVIM_RUNTIME_DIR}\"#"g \
- -e s"#CONFIG_DIR_VAR#\"${LUNARVIM_CONFIG_DIR}\"#"g \
- -e s"#CACHE_DIR_VAR#\"${LUNARVIM_CACHE_DIR}\"#"g \
- -e s"#BASE_DIR_VAR#\"${LUNARVIM_BASE_DIR}\"#"g "$src" \
+ sed -e s"#NVIM_APPNAME_VAR#\"${NVIM_APPNAME}\"#"g \
+ -e s"#XDG_DATA_HOME_VAR#\"${XDG_DATA_HOME}\"#"g "$src" \
| tee "$dst" >/dev/null
chmod u+x "$dst"
@@ -35,4 +27,4 @@ function setup_shim() {
setup_shim "$@"
-echo "You can start LunarVim by running: $INSTALL_PREFIX/bin/lvim"
+echo "You can start LunarVim by running: $XDG_DATA_HOME/.local/bin/lvim"