refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / vim-sensible / install.sh
index e19a75bd7748d4c63a74c615342773f3cc96412f..6df2de5e09c48a2293ba8a1b4b6c3ca5ba150cec 100644 (file)
@@ -1,13 +1,19 @@
 #!/bin/bash
 
-# title: vim-sensible
-# homepage: https://github.com/tpope/vim-sensible
-# tagline: sensible defaults for vim
-# description: |
-#   Think of sensible.vim as one step above 'nocompatible' mode: a universal set of defaults that (hopefully) everyone can agree on.
-# examples: |
-#   N/A
-
-mkdir -p $HOME/.vim/pack/plugins/start
-rm -rf $HOME/.vim/pack/plugins/start/sensible
-git clone --depth=1 https://tpope.io/vim/sensible.git $HOME/.vim/pack/plugins/start/sensible
+function __init_vim_sensible() {
+    set -e
+    set -u
+
+    mkdir -p "$HOME/.vim/pack/plugins/start"
+    rm -rf "$HOME/.vim/pack/plugins/start/sensible" "$HOME/.vim/pack/plugins/start/vim-sensible"
+
+    # Note: we've had resolution issues in the past, and it doesn't seem likely
+    #       that tpope will switch from using GitHub as the primary host, so we
+    #       skip the redirect and use GitHub directly.
+    #       Open to changing this back in the future.
+    #my_sensible_repo="https://tpope.io/vim/sensible.git"
+    my_sensible_repo="https://github.com/tpope/vim-sensible.git"
+    git clone --depth=1 "${my_sensible_repo}" "$HOME/.vim/pack/plugins/start/vim-sensible"
+}
+
+__init_vim_sensible