dotfiles

My personal dotfiles 💠️

nvim-install (423B)

      1 #!/bin/sh
      2 
      3 url="$1"
      4 
      5 for repo in "$@"
      6 do
      7   sub_dir="$(echo "$url" | grep -o '[^/]*/[^/]*$' | grep -o '^[^/]*')"
      8   pack="$(echo "$url" | grep -o '[^/]*$' | grep -o '^[^.]*')"
      9   install_dir="$HOME/.local/share/nvim/site/pack/$sub_dir/start/$pack"
     10 
     11   if [ -d "$install_dir" ]
     12   then
     13     # Update the repository
     14     cd "$install_dir"
     15     git pull
     16   else
     17     # Clone the repository
     18     git clone "$url" "$install_dir"
     19   fi
     20 done