fix: again

This commit is contained in:
pika 2025-03-17 19:57:16 +01:00
parent 970f96779d
commit 1a3e0c4c0f

View file

@ -107,28 +107,40 @@
inst_generic() {
tempdir="$(mktemp -d)"
if [ ! -d "$HOME/.bin" ]; then
mkdir "$HOME/.bin"
mkdir -p "$HOME/.bin"
fi
echo_info "Fetching latest stable Neovim version..."
latest_version=$(curl -s https://api.github.com/repos/neovim/neovim/releases/latest | grep 'tag_name' | cut -d\" -f4)
echo_info "Downloading Neovim version $latest_version..."
curl -fsSL -o "$tempdir/nvim.tar.gz" "https://github.com/neovim/neovim/releases/download/${latest_version}/nvim-linux-x86_64.tar.gz" && cd "$tempdir"
# https://github.com/neovim/neovim/releases/download/v0.10.4/nvim-linux-x86_64.tar.gz
tar -xf nvim.tar.gz
cp -r ./nvim-linux64 "$HOME/.bin"
# Download the tarball
curl -fsSL -o "$tempdir/nvim.tar.gz" "https://github.com/neovim/neovim/releases/download/${latest_version}/nvim-linux-x86_64.tar.gz"
# Change to the temporary directory and extract
cd "$tempdir"
tar -xzf nvim.tar.gz
# Remove old installation if it exists
rm -rf "$HOME/.bin/nvim-linux64"
# Copy to destination
cp -r ./nvim-linux64 "$HOME/.bin/"
# Create symlinks with absolute paths
inst_paths="/usr/bin /usr/share/bin $HOME/.local/bin"
for in_path in $inst_paths; do
if [ -d "$in_path" ]; then
echo_info "Installing into $in_path"
$_sudo ln -r -s "$HOME/.bin/nvim-linux64/bin/nvim" "$in_path"
$_sudo ln -sf "$HOME/.bin/nvim-linux64/bin/nvim" "$in_path/nvim"
fi
done
# Clean up
rm -rf "$tempdir"
echo_info "Neovim $latest_version installed successfully"
}
# ─< Distribution detection and installation >────────────────────────────────────────