summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-10-07 04:51:09 +0200
committerGitHub <[email protected]>2022-10-06 22:51:09 -0400
commitf6402563abb3ace148168a27e7889c961dd94bfd (patch)
tree028cd4e2b397802d582ef7e9f35d3c8eb159f7a4 /utils
parent40e2d5a1715ab7cdb0c4b4d849f1628caadb6842 (diff)
feat: enable global installation (#3161)
Diffstat (limited to 'utils')
-rw-r--r--utils/bin/lvim.ps12
-rw-r--r--utils/bin/lvim.template6
-rwxr-xr-xutils/installer/install.sh22
-rwxr-xr-xutils/installer/install_bin.sh3
4 files changed, 18 insertions, 15 deletions
diff --git a/utils/bin/lvim.ps1 b/utils/bin/lvim.ps1
index 32723c18..3ec8125c 100644
--- a/utils/bin/lvim.ps1
+++ b/utils/bin/lvim.ps1
@@ -10,4 +10,4 @@ $env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvi
$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim"
$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim"
-nvim -u "$env:LUNARVIM_RUNTIME_DIR\lvim\init.lua" @args
+nvim -u "$env:LUNARVIM_BASE_DIR\init.lua" @args
diff --git a/utils/bin/lvim.template b/utils/bin/lvim.template
index 1b18977d..c17d25be 100644
--- a/utils/bin/lvim.template
+++ b/utils/bin/lvim.template
@@ -1,7 +1,9 @@
-#!/bin/sh
+#!/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}"
-exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@"
+export LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-BASE_DIR_VAR}"
+
+exec -a lvim nvim -u "$LUNARVIM_BASE_DIR/init.lua" "$@"
diff --git a/utils/installer/install.sh b/utils/installer/install.sh
index fee0e420..cafd92ad 100755
--- a/utils/installer/install.sh
+++ b/utils/installer/install.sh
@@ -2,20 +2,20 @@
set -eo pipefail
#Set branch to master unless specified by the user
-declare LV_BRANCH="${LV_BRANCH:-"master"}"
-declare -r LV_REMOTE="${LV_REMOTE:-lunarvim/lunarvim.git}"
-declare -r INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
+declare -x LV_BRANCH="${LV_BRANCH:-"master"}"
+declare -xr LV_REMOTE="${LV_REMOTE:-lunarvim/lunarvim.git}"
+declare -xr INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
-declare -r XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}"
-declare -r XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}"
-declare -r XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}"
+declare -xr XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}"
+declare -xr XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+declare -xr XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}"
-declare -r LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}"
-declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}"
-declare -r LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}"
-declare -r LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}"
+declare -xr LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}"
+declare -xr LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}"
+declare -xr LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}"
+declare -xr LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}"
-declare -r LUNARVIM_LOG_LEVEL="${LUNARVIM_LOG_LEVEL:-warn}"
+declare -xr LUNARVIM_LOG_LEVEL="${LUNARVIM_LOG_LEVEL:-warn}"
declare BASEDIR
BASEDIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
diff --git a/utils/installer/install_bin.sh b/utils/installer/install_bin.sh
index c6ad5181..920f2fd5 100755
--- a/utils/installer/install_bin.sh
+++ b/utils/installer/install_bin.sh
@@ -26,7 +26,8 @@ function setup_shim() {
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 "$src" \
+ -e s"#CACHE_DIR_VAR#\"${LUNARVIM_CACHE_DIR}\"#"g \
+ -e s"#BASE_DIR_VAR#\"${LUNARVIM_BASE_DIR}\"#"g "$src" \
| tee "$dst" >/dev/null
chmod u+x "$dst"