auto-add nvim to .bashrc_paths after install
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1cb92d240f
commit
4fa2c74fca
@ -10,6 +10,7 @@ echo " - apt-get update (if curl not installed)"
|
||||
echo " - apt-get install -y curl (if needed)"
|
||||
echo " - rm -rf /opt/nvim-linux64 or /opt/nvim-linux-x86_64 (if old installation exists)"
|
||||
echo " - tar -C /opt -xzf nvim-linux-x86_64.tar.gz"
|
||||
echo " - add nvim to PATH in ~/setup_env/dotfiles/.bashrc_paths (if not already there)"
|
||||
echo ""
|
||||
read -p "Continue with installation? (y/N) " -n 1 -r
|
||||
echo
|
||||
@ -73,8 +74,17 @@ if [ -x /opt/nvim-linux-x86_64/bin/nvim ]; then
|
||||
/opt/nvim-linux-x86_64/bin/nvim --version | head -n1
|
||||
echo ""
|
||||
echo "Neovim is installed at: /opt/nvim-linux-x86_64/bin/nvim"
|
||||
echo "Add to PATH by adding this to your ~/.bashrc:"
|
||||
echo ' export PATH="$PATH:/opt/nvim-linux-x86_64/bin"'
|
||||
|
||||
# Add to .bashrc_paths if not already there
|
||||
BASHRC_PATHS="$HOME/setup_env/dotfiles/.bashrc_paths"
|
||||
NVIM_PATH_LINE='[ -d /opt/nvim-linux-x86_64/bin ] && export PATH="/opt/nvim-linux-x86_64/bin:$PATH"'
|
||||
if [ -f "$BASHRC_PATHS" ] && ! grep -qF "nvim-linux-x86_64" "$BASHRC_PATHS"; then
|
||||
echo "" >> "$BASHRC_PATHS"
|
||||
echo "# Neovim (installed by install_neovim.sh)" >> "$BASHRC_PATHS"
|
||||
echo "$NVIM_PATH_LINE" >> "$BASHRC_PATHS"
|
||||
echo "Added nvim to PATH in $BASHRC_PATHS"
|
||||
echo "Run 'source ~/.bashrc' to apply."
|
||||
fi
|
||||
else
|
||||
echo "Error: Neovim installation failed" >&2
|
||||
exit 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user