Skip to content

Commit

Permalink
update: install nvim from a release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
horseinthesky committed Dec 1, 2024
1 parent 769d5de commit edeb91a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ symlink () {

if [[ -f $link ]] && [[ ! -L $link ]]; then
cp "$link" "$link".bak
info "$link backed up"
elif [[ -d $link ]] && [[ ! -L $link ]]; then
cp -R "$link" "$link".bak
info "$link backed up"
fi

info "$link backed up"

local symlink_dir=$(dirname "$link")
[[ ! -d $symlink_dir ]] && mkdir -p "$symlink_dir"

Expand Down
30 changes: 23 additions & 7 deletions scripts/nvim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,35 @@ install_deps () {
install_neovim () {
header "Installing Neovim ..."

clone neovim/neovim "$HOME"
[[ $? -ne 0 ]] && exit
if [[ -d $HOME/neovim ]]; then
warning "neovim already exists. Updating..."
cd "$HOME"/neovim && git pull 1> /dev/null
success

exit
fi

local branch=release-0.10

git clone --depth 1 --branch "$branch" https://github.com/neovim/neovim.git "$HOME"/neovim
if [[ $? -ne 0 ]]; then
error "Failed to clone neovim"
exit
fi

info "Building neovim from source..."
info "\nBuilding neovim from source..."

cd "$HOME"/neovim \
&& make distclean \
&& rm -rf "$HOME"/.local/share/nvim/runtime \
&& git checkout remotes/origin/release-0.10 \
&& make distclean \
&& make \
CMAKE_BUILD_TYPE=Release \
CMAKE_INSTALL_PREFIX="$HOME"/.local install 1> /dev/null \
&& git checkout master
CMAKE_INSTALL_PREFIX="$HOME"/.local install 1> /dev/null

if [[ $? -ne 0 ]]; then
error "Failed to build neovim"
exit
fi

success
}
Expand Down

0 comments on commit edeb91a

Please sign in to comment.