replaced case with if statements

This commit is contained in:
radumacocian
2024-08-19 18:14:53 +02:00
parent a2dba81ae5
commit a3613d0381
2 changed files with 27 additions and 30 deletions

View File

@@ -17,36 +17,33 @@ else
fi fi
echo "----- Downloading NVIM -----" echo "----- Downloading NVIM -----"
case "$OSTYPE" in if [[ "$OSTYPE" == "linux"* ]]; then
linux*) nvim_path="/opt/nvim-linux64"
nvim_path="/opt/nvim-linux64" echo "Downloading nvim"
echo "Downloading nvim" curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz sudo rm -rf /opt/nvim
sudo rm -rf /opt/nvim echo "Copying NVIM to /opt/nvim-linux64"
echo "Copying NVIM to /opt/nvim-linux64" sudo tar -C /opt -xzf nvim-linux64.tar.gz
sudo tar -C /opt -xzf nvim-linux64.tar.gz echo "Adding NVIM to PATH in ./bashrc"
echo "Adding NVIM to PATH in ./bashrc" echo "export PATH="\$PATH:$nvim_path/bin"" >> ~/.bashrc
echo "export PATH="\$PATH:$nvim_path/bin"" >> ~/.bashrc echo "NVIM added to path, run '. ~/.bashrc' to reload PATH variable"
echo "NVIM added to path, run '. ~/.bashrc' to reload PATH variable" elif [[ "$OSTYPE" == "darwin"* ]]; then
;; nvim_path="~/Applications/nvim"
darwin*) if [ -d "$HOME/Applications/nvim" ]; then
nvim_path="~/Applications/nvim" echo "[Skipped] NVIM already installed"
if [ -d "$HOME/Applications/nvim" ]; then else
echo "[Skipped] NVIM already installed" curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
else tar xzf nvim-macos-arm64.tar.gz
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz mv nvim-macos-arm64 $nvim_path
tar xzf nvim-macos-arm64.tar.gz fi
mv nvim-macos-arm64 $nvim_path elif [[ "$OSTYPE" == "msys"* ]]; then
fi if [ "$env:Path" == "*Neovim*" ]; then
;; echo "[Skipped NVIM already installed"
msys*) else
if [ "$env:Path" == "*Neovim*" ]; then curl -o nvim-win64.msi https://github.com/neovim/neovim/releases/latest/download/nvim-win64.msi
echo "[Skipped NVIM already installed" ./nvim-win64.msi /passive
else fi
curl -o nvim-win64.msi https://github.com/neovim/neovim/releases/latest/download/nvim-win64.msi fi
./nvim-win64.msi /passive
fi
esac
if [[ ! -d "$HOME/.local/share/nvim/roslyn" ]] then if [[ ! -d "$HOME/.local/share/nvim/roslyn" ]] then
echo "----- Roslyn LS not detected: Downloading now -----" echo "----- Roslyn LS not detected: Downloading now -----"