Fix formatting according to style-guide (#1057)

This commit is contained in:
kylo252 2021-08-12 11:31:31 +02:00 committed by GitHub
parent 4fd72b1be2
commit 03b7da74ee
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 213 additions and 212 deletions

View file

@ -37,7 +37,8 @@ jobs:
run: | run: |
GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
# https://google.github.io/styleguide/shellguide.html
- name: Check formatting - name: Check formatting
run: | run: |
shfmt -l -d . shfmt -i 2 -ci -l -d .

View file

@ -97,7 +97,7 @@ function M.setup(filetype)
local builtin_formatter = null_ls.builtins.formatting[formatter.exe] local builtin_formatter = null_ls.builtins.formatting[formatter.exe]
if not vim.tbl_contains(M.requested_providers, builtin_formatter) then if not vim.tbl_contains(M.requested_providers, builtin_formatter) then
-- FIXME: why doesn't this work? -- FIXME: why doesn't this work?
-- builtin_formatter._opts.args = formatter.args or builtin_formatter._opts.args builtin_formatter._opts.args = formatter.args or builtin_formatter._opts.args
-- builtin_formatter._opts.to_stdin = formatter.stdin or builtin_formatter._opts.to_stdin -- builtin_formatter._opts.to_stdin = formatter.stdin or builtin_formatter._opts.to_stdin
local resolved_path = validate_provider_request(builtin_formatter) local resolved_path = validate_provider_request(builtin_formatter)
if resolved_path then if resolved_path then

View file

@ -8,31 +8,31 @@
# to point to the `config_mac' or `config_win` folders depending on your system. # to point to the `config_mac' or `config_win` folders depending on your system.
case Darwin in case Darwin in
Linux) Linux)
CONFIG="$HOME/.local/share/nvim/lspinstall/java/config_linux" CONFIG="$HOME/.local/share/nvim/lspinstall/java/config_linux"
;; ;;
Darwin) Darwin)
CONFIG="$HOME/.local/share/nvim/lspinstall/java/config_mac" CONFIG="$HOME/.local/share/nvim/lspinstall/java/config_mac"
;; ;;
esac esac
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ]; then if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD="$JAVA_HOME/jre/sh/java"
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD="$JAVA_HOME/bin/java"
fi fi
if [ ! -x "$JAVACMD" ]; then if [ ! -x "$JAVACMD" ]; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
@ -41,20 +41,20 @@ fi
# JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar" # JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar"
JAR="$HOME/.local/share/nvim/lspinstall/java/plugins/org.eclipse.equinox.launcher_*.jar" JAR="$HOME/.local/share/nvim/lspinstall/java/plugins/org.eclipse.equinox.launcher_*.jar"
GRADLE_HOME=$HOME/gradle "$JAVACMD" \ GRADLE_HOME=$HOME/gradle "$JAVACMD" \
-Declipse.application=org.eclipse.jdt.ls.core.id1 \ -Declipse.application=org.eclipse.jdt.ls.core.id1 \
-Dosgi.bundles.defaultStartLevel=4 \ -Dosgi.bundles.defaultStartLevel=4 \
-Declipse.product=org.eclipse.jdt.ls.core.product \ -Declipse.product=org.eclipse.jdt.ls.core.product \
-Dlog.protocol=true \ -Dlog.protocol=true \
-Dlog.level=ALL \ -Dlog.level=ALL \
-javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \ -javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \
-Xms1g \ -Xms1g \
-Xmx2G \ -Xmx2G \
-jar $(echo "$JAR") \ -jar $(echo "$JAR") \
-configuration "$CONFIG" \ -configuration "$CONFIG" \
-data "${1:-$HOME/workspace}" \ -data "${1:-$HOME/workspace}" \
--add-modules=ALL-SYSTEM \ --add-modules=ALL-SYSTEM \
--add-opens java.base/java.util=ALL-UNNAMED \ --add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
# for older java versions if you wanna use lombok # for older java versions if you wanna use lombok
# -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \ # -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \

View file

@ -6,227 +6,227 @@ set -o nounset # error when referencing undefined variable
set -o errexit # exit when command fails set -o errexit # exit when command fails
installnodemac() { installnodemac() {
brew install lua brew install lua
brew install node brew install node
brew install yarn brew install yarn
} }
installnodeubuntu() { installnodeubuntu() {
sudo apt install nodejs sudo apt install nodejs
sudo apt install npm sudo apt install npm
} }
installnodetermux() { installnodetermux() {
apt install nodejs apt install nodejs
} }
moveoldlvim() { moveoldlvim() {
echo "Not installing LunarVim" echo "Not installing LunarVim"
echo "Please move your ~/.local/share/lunarvim folder before installing" echo "Please move your ~/.local/share/lunarvim folder before installing"
exit exit
} }
installnodearch() { installnodearch() {
sudo pacman -S nodejs sudo pacman -S nodejs
sudo pacman -S npm sudo pacman -S npm
} }
installnodefedora() { installnodefedora() {
sudo dnf install -y nodejs sudo dnf install -y nodejs
sudo dnf install -y npm sudo dnf install -y npm
} }
installnodegentoo() { installnodegentoo() {
echo "Printing current node status..." echo "Printing current node status..."
emerge -pqv net-libs/nodejs emerge -pqv net-libs/nodejs
echo "Make sure the npm USE flag is enabled for net-libs/nodejs" echo "Make sure the npm USE flag is enabled for net-libs/nodejs"
echo "If it isn't enabled, would you like to enable it with flaggie? (Y/N)" echo "If it isn't enabled, would you like to enable it with flaggie? (Y/N)"
read -r answer read -r answer
[ "$answer" != "${answer#[Yy]}" ] && sudo flaggie net-libs/nodejs +npm [ "$answer" != "${answer#[Yy]}" ] && sudo flaggie net-libs/nodejs +npm
sudo emerge -avnN net-libs/nodejs sudo emerge -avnN net-libs/nodejs
} }
installnode() { installnode() {
echo "Installing node..." echo "Installing node..."
[ "$(uname)" = "Darwin" ] && installnodemac [ "$(uname)" = "Darwin" ] && installnodemac
grep -q Ubuntu /etc/os-release && installnodeubuntu grep -q Ubuntu /etc/os-release && installnodeubuntu
[ -f "/etc/arch-release" ] && installnodearch [ -f "/etc/arch-release" ] && installnodearch
[ -f "/etc/artix-release" ] && installnodearch [ -f "/etc/artix-release" ] && installnodearch
[ -f "/etc/fedora-release" ] && installnodefedora [ -f "/etc/fedora-release" ] && installnodefedora
[ -f "/etc/gentoo-release" ] && installnodegentoo [ -f "/etc/gentoo-release" ] && installnodegentoo
[ -d "/data/data/com.termux" ] && installnodetermux [ -d "/data/data/com.termux" ] && installnodetermux
[ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported" [ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported"
sudo npm i -g neovim sudo npm i -g neovim
} }
installpiponmac() { installpiponmac() {
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py python3 get-pip.py
rm get-pip.py rm get-pip.py
} }
installpiponubuntu() { installpiponubuntu() {
sudo apt install python3-pip >/dev/null sudo apt install python3-pip >/dev/null
} }
installpipontermux() { installpipontermux() {
apt install python apt install python
} }
installpiponarch() { installpiponarch() {
sudo pacman -S python-pip sudo pacman -S python-pip
} }
installpiponfedora() { installpiponfedora() {
sudo dnf install -y pip >/dev/null sudo dnf install -y pip >/dev/null
} }
installpipongentoo() { installpipongentoo() {
sudo emerge -avn dev-python/pip sudo emerge -avn dev-python/pip
} }
installpip() { installpip() {
echo "Installing pip..." echo "Installing pip..."
[ "$(uname)" = "Darwin" ] && installpiponmac [ "$(uname)" = "Darwin" ] && installpiponmac
grep -q Ubuntu /etc/os-release && installpiponubuntu grep -q Ubuntu /etc/os-release && installpiponubuntu
[ -f "/etc/arch-release" ] && installpiponarch [ -f "/etc/arch-release" ] && installpiponarch
[ -f "/etc/fedora-release" ] && installpiponfedora [ -f "/etc/fedora-release" ] && installpiponfedora
[ -f "/etc/gentoo-release" ] && installpipongentoo [ -f "/etc/gentoo-release" ] && installpipongentoo
[ -d "/data/data/com.termux" ] && installpipontermux [ -d "/data/data/com.termux" ] && installpipontermux
[ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported" [ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported"
} }
installpynvim() { installpynvim() {
echo "Installing pynvim..." echo "Installing pynvim..."
if [ -f "/etc/gentoo-release" ]; then if [ -f "/etc/gentoo-release" ]; then
echo "Installing using Portage" echo "Installing using Portage"
sudo emerge -avn dev-python/pynvim sudo emerge -avn dev-python/pynvim
else else
pip3 install pynvim --user pip3 install pynvim --user
fi fi
} }
installpacker() { installpacker() {
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/lunarvim/site/pack/packer/start/packer.nvim git clone https://github.com/wbthomason/packer.nvim ~/.local/share/lunarvim/site/pack/packer/start/packer.nvim
} }
cloneconfig() { cloneconfig() {
if [ -d "/data/data/com.termux" ]; then if [ -d "/data/data/com.termux" ]; then
sudo() { sudo() {
eval "$@" eval "$@"
} }
USER_BIN_DIR="$HOME/../usr/bin" USER_BIN_DIR="$HOME/../usr/bin"
fi fi
echo "Cloning LunarVim configuration" echo "Cloning LunarVim configuration"
mkdir -p ~/.local/share/lunarvim mkdir -p ~/.local/share/lunarvim
case "$@" in case "$@" in
*--testing*) *--testing*)
cp -r "$(pwd)" ~/.local/share/lunarvim/lvim cp -r "$(pwd)" ~/.local/share/lunarvim/lvim
;; ;;
*) *)
git clone --branch "$LVBRANCH" https://github.com/lunarvim/lunarvim.git ~/.local/share/lunarvim/lvim git clone --branch "$LVBRANCH" https://github.com/lunarvim/lunarvim.git ~/.local/share/lunarvim/lvim
;; ;;
esac esac
mkdir -p "$HOME/.config/lvim" mkdir -p "$HOME/.config/lvim"
sudo cp "$HOME/.local/share/lunarvim/lvim/utils/bin/lvim" "$USER_BIN_DIR" sudo cp "$HOME/.local/share/lunarvim/lvim/utils/bin/lvim" "$USER_BIN_DIR"
sudo chmod a+rx "$USER_BIN_DIR"/lvim sudo chmod a+rx "$USER_BIN_DIR"/lvim
cp "$HOME/.local/share/lunarvim/lvim/utils/installer/config.example-no-ts.lua" "$HOME/.config/lvim/config.lua" cp "$HOME/.local/share/lunarvim/lvim/utils/installer/config.example-no-ts.lua" "$HOME/.config/lvim/config.lua"
nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \ nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \
+'autocmd User PackerComplete sleep 100m | qall' \ +'autocmd User PackerComplete sleep 100m | qall' \
+PackerInstall +PackerInstall
nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \ nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" --headless \
+'autocmd User PackerComplete sleep 100m | qall' \ +'autocmd User PackerComplete sleep 100m | qall' \
+PackerSync +PackerSync
printf "\nCompile Complete\n" printf "\nCompile Complete\n"
if [ -e "$HOME/.local/share/lunarvim/lvim/init.lua" ]; then if [ -e "$HOME/.local/share/lunarvim/lvim/init.lua" ]; then
echo 'config.lua already present' echo 'config.lua already present'
else else
cp "$HOME/.local/share/lunarvim/lvim/utils/installer/config.example.lua" "$HOME/.config/lvim/config.lua" cp "$HOME/.local/share/lunarvim/lvim/utils/installer/config.example.lua" "$HOME/.config/lvim/config.lua"
fi fi
} }
asktoinstallnode() { asktoinstallnode() {
echo "node not found" echo "node not found"
printf "Would you like to install node now (y/n)? " printf "Would you like to install node now (y/n)? "
read -r answer read -r answer
[ "$answer" != "${answer#[Yy]}" ] && installnode [ "$answer" != "${answer#[Yy]}" ] && installnode
} }
asktoinstallgit() { asktoinstallgit() {
echo "git not found, please install git" echo "git not found, please install git"
exit exit
} }
asktoinstallpip() { asktoinstallpip() {
# echo "pip not found" # echo "pip not found"
# echo -n "Would you like to install pip now (y/n)? " # echo -n "Would you like to install pip now (y/n)? "
# read answer # read answer
# [ "$answer" != "${answer#[Yy]}" ] && installpip # [ "$answer" != "${answer#[Yy]}" ] && installpip
echo "Please install pip3 before continuing with install" echo "Please install pip3 before continuing with install"
exit exit
} }
installonmac() { installonmac() {
brew install ripgrep fzf brew install ripgrep fzf
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installonubuntu() { installonubuntu() {
sudo apt install ripgrep fzf sudo apt install ripgrep fzf
sudo apt install libjpeg8-dev zlib1g-dev python-dev python3-dev libxtst-dev sudo apt install libjpeg8-dev zlib1g-dev python-dev python3-dev libxtst-dev
pip3 install neovim-remote pip3 install neovim-remote
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installtermux() { installtermux() {
apt install ripgrep fzf apt install ripgrep fzf
pip install neovim-remote pip install neovim-remote
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installonarch() { installonarch() {
sudo pacman -S ripgrep fzf sudo pacman -S ripgrep fzf
pip3 install neovim-remote pip3 install neovim-remote
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installonfedora() { installonfedora() {
sudo dnf groupinstall "X Software Development" sudo dnf groupinstall "X Software Development"
sudo dnf install -y fzf ripgrep sudo dnf install -y fzf ripgrep
} }
installongentoo() { installongentoo() {
sudo emerge -avn sys-apps/ripgrep app-shells/fzf dev-python/neovim-remote virtual/jpeg sys-libs/zlib sudo emerge -avn sys-apps/ripgrep app-shells/fzf dev-python/neovim-remote virtual/jpeg sys-libs/zlib
npm install -g tree-sitter-cli npm install -g tree-sitter-cli
} }
installextrapackages() { installextrapackages() {
[ "$(uname)" = "Darwin" ] && installonmac [ "$(uname)" = "Darwin" ] && installonmac
grep -q Ubuntu /etc/os-release && installonubuntu grep -q Ubuntu /etc/os-release && installonubuntu
[ -f "/etc/arch-release" ] && installonarch [ -f "/etc/arch-release" ] && installonarch
[ -f "/etc/artix-release" ] && installonarch [ -f "/etc/artix-release" ] && installonarch
[ -f "/etc/fedora-release" ] && installonfedora [ -f "/etc/fedora-release" ] && installonfedora
[ -f "/etc/gentoo-release" ] && installongentoo [ -f "/etc/gentoo-release" ] && installongentoo
[ -d "/data/data/com.termux" ] && installtermux [ -d "/data/data/com.termux" ] && installtermux
[ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported" [ "$(uname -s | cut -c 1-10)" = "MINGW64_NT" ] && echo "Windows not currently supported"
} }
# Welcome # Welcome
echo 'Installing LunarVim' echo 'Installing LunarVim'
case "$@" in case "$@" in
*--overwrite*) *--overwrite*)
echo '!!Warning!! -> Removing all lunarvim related config because of the --overwrite flag' echo '!!Warning!! -> Removing all lunarvim related config because of the --overwrite flag'
rm -rf "$HOME/.local/share/lunarvim" rm -rf "$HOME/.local/share/lunarvim"
rm -rf "$HOME/.cache/nvim" rm -rf "$HOME/.cache/nvim"
rm -rf "$HOME/.config/lvim" rm -rf "$HOME/.config/lvim"
;; ;;
esac esac
# move old lvim directory if it exists # move old lvim directory if it exists
@ -245,27 +245,27 @@ esac
(pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on...") || installpynvim (pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on...") || installpynvim
if [ -e "$HOME/.local/share/lunarvim/site/pack/packer/start/packer.nvim" ]; then if [ -e "$HOME/.local/share/lunarvim/site/pack/packer/start/packer.nvim" ]; then
echo 'packer already installed' echo 'packer already installed'
else else
installpacker installpacker
fi fi
if [ -e "$HOME/.local/share/lunarvim/lvim/init.lua" ]; then if [ -e "$HOME/.local/share/lunarvim/lvim/init.lua" ]; then
echo 'LunarVim already installed' echo 'LunarVim already installed'
else else
# clone config down # clone config down
cloneconfig "$@" cloneconfig "$@"
# echo 'export PATH=$HOME/.config/nvim/utils/bin:$PATH' >>~/.zshrc # echo 'export PATH=$HOME/.config/nvim/utils/bin:$PATH' >>~/.zshrc
# echo 'export PATH=$HOME/.config/lunarvim/utils/bin:$PATH' >>~/.bashrc # echo 'export PATH=$HOME/.config/lunarvim/utils/bin:$PATH' >>~/.bashrc
fi fi
if [ "$(uname)" != "Darwin" ]; then if [ "$(uname)" != "Darwin" ]; then
if [ -e "$HOME/.local/share/applications/lvim.desktop" ]; then if [ -e "$HOME/.local/share/applications/lvim.desktop" ]; then
echo 'Desktop file already available' echo 'Desktop file already available'
else else
mkdir -p "$HOME/.local/share/applications" mkdir -p "$HOME/.local/share/applications"
cp "$HOME/.local/share/lunarvim/lvim/utils/desktop/lvim.desktop" "$HOME/.local/share/applications/lvim.desktop" cp "$HOME/.local/share/lunarvim/lvim/utils/desktop/lvim.desktop" "$HOME/.local/share/applications/lvim.desktop"
fi fi
fi fi
echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts" echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts"

View file

@ -11,53 +11,53 @@ declare -r FILENAME="stylua-$RELEASE-$OS"
declare -a __deps=("curl" "unzip") declare -a __deps=("curl" "unzip")
function check_deps() { function check_deps() {
for dep in "${__deps[@]}"; do for dep in "${__deps[@]}"; do
if ! command -v "$dep" >/dev/null; then if ! command -v "$dep" >/dev/null; then
echo "Missing depdendecy!" echo "Missing depdendecy!"
echo "The \"$dep\" command was not found!. Please install and try again." echo "The \"$dep\" command was not found!. Please install and try again."
fi fi
done done
} }
function download_stylua() { function download_stylua() {
local DOWNLOAD_DIR local DOWNLOAD_DIR
local URL="https://github.com/JohnnyMorganz/StyLua/releases/download/v$RELEASE/$FILENAME.zip" local URL="https://github.com/JohnnyMorganz/StyLua/releases/download/v$RELEASE/$FILENAME.zip"
DOWNLOAD_DIR="$(mktemp -d)" DOWNLOAD_DIR="$(mktemp -d)"
echo "Initiating download for Stylua v$RELEASE" echo "Initiating download for Stylua v$RELEASE"
if ! curl --progress-bar --fail -L "$URL" -o "$DOWNLOAD_DIR/$FILENAME.zip"; then if ! curl --progress-bar --fail -L "$URL" -o "$DOWNLOAD_DIR/$FILENAME.zip"; then
echo "Download failed. Check that the release/filename are correct." echo "Download failed. Check that the release/filename are correct."
exit 1 exit 1
fi fi
echo "Installation in progress.." echo "Installation in progress.."
unzip -q "$DOWNLOAD_DIR/$FILENAME.zip" -d "$DOWNLOAD_DIR" unzip -q "$DOWNLOAD_DIR/$FILENAME.zip" -d "$DOWNLOAD_DIR"
if [ -f "$DOWNLOAD_DIR/stylua" ]; then if [ -f "$DOWNLOAD_DIR/stylua" ]; then
mv "$DOWNLOAD_DIR/stylua" "$INSTALL_DIR/stylua" mv "$DOWNLOAD_DIR/stylua" "$INSTALL_DIR/stylua"
else else
mv "$DOWNLOAD_DIR/$FILENAME/stylua" "$INSTALL_DIR/." mv "$DOWNLOAD_DIR/$FILENAME/stylua" "$INSTALL_DIR/."
fi fi
chmod u+x "$INSTALL_DIR/stylua" chmod u+x "$INSTALL_DIR/stylua"
} }
function verify_install() { function verify_install() {
echo "Verifying installation.." echo "Verifying installation.."
local DOWNLOADED_VER local DOWNLOADED_VER
DOWNLOADED_VER="$("$INSTALL_DIR/stylua" -V | awk '{ print $2 }')" DOWNLOADED_VER="$("$INSTALL_DIR/stylua" -V | awk '{ print $2 }')"
if [ "$DOWNLOADED_VER" != "$RELEASE" ]; then if [ "$DOWNLOADED_VER" != "$RELEASE" ]; then
echo "Mismatched version!" echo "Mismatched version!"
echo "Expected: v$RELEASE but got v$DOWNLOADED_VER" echo "Expected: v$RELEASE but got v$DOWNLOADED_VER"
exit 1 exit 1
fi fi
echo "Verification complete!" echo "Verification complete!"
} }
function main() { function main() {
check_deps check_deps
download_stylua download_stylua
verify_install verify_install
} }
main "$@" main "$@"

View file

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
USER_BIN_DIR="/usr/local/bin" USER_BIN_DIR="/usr/local/bin"
if [ -d "/data/data/com.termux" ]; then if [ -d "/data/data/com.termux" ]; then
sudo() { sudo() {
eval "$@" eval "$@"
} }
USER_BIN_DIR="$HOME/../usr/bin" USER_BIN_DIR="$HOME/../usr/bin"
fi fi
rm -rf ~/.local/share/lunarvim rm -rf ~/.local/share/lunarvim
sudo rm "$USER_BIN_DIR"/lvim sudo rm "$USER_BIN_DIR"/lvim