aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/install.sh
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-10-05 17:56:51 -0500
committerToby Vincent <tobyv13@gmail.com>2022-10-05 17:56:51 -0500
commit2b3985da873b2337a2ebe083f4d1f15cc1930171 (patch)
tree5cca08ebc7ca3028bc769274421a463e0dc34907 /install.sh
parent9fb834504f3f34466590ee2c0978d89ce65808de (diff)
feat(nvim): add mason-update-all and add nvim flag to install.sh
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/install.sh b/install.sh
index 0ea1259..466469e 100755
--- a/install.sh
+++ b/install.sh
@@ -4,8 +4,8 @@ SCRIPT="$(basename "$0")"
SCRIPT_DIR="$(dirname -- "$(readlink -f -- "$0")")"
INSTALL_DIR="$(dirname "$SCRIPT_DIR")"
-long='clean,clean-only,no,simulate,verbose,help'
-short='cCnvh'
+long='nvim,clean,clean-only,no,simulate,verbose,help'
+short='ecCnvh'
opts="$(getopt -o $short -l $long -n "$SCRIPT" -- "$@")"
@@ -30,6 +30,7 @@ help() {
$SCRIPT [OPTION ...] [PACKAGE ...]
OPTIONS:
+ -e, --nvim Run neovim update commands
-c, --clean Remove broken symlinks found in $INSTALL_DIR for proceeding
-C, --clean-only Like --clean, but will exit after cleaning
-n, --no, --simulate Do not actually make any filesystem changes
@@ -71,6 +72,7 @@ need() {
done
}
+nvim=false
clean=false
clean_only=false
verbose=0
@@ -85,6 +87,10 @@ while true; do
verbose=$((verbose + 1))
shift
;;
+ -e | --nvim)
+ nvim=true
+ shift
+ ;;
-c | --clean)
clean=true
shift
@@ -154,3 +160,11 @@ say_verbose "Installing: $*"
# shellcheck disable=2068,2086
stow $verbose_args $simulate $@
+
+if $nvim; then
+ need nvim
+ # Update Packer plugins
+ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
+ # Update Mason packages
+ nvim --headless -c 'autocmd User MasonUpdateAllComplete quitall' -c 'MasonUpdateAll'
+fi