From cb431ee1a0be1ad46b8a9c48b49464492a2ce732 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Thu, 16 Feb 2023 20:58:07 +0100 Subject: [PATCH] add update-nvim-plugins script --- justfile | 2 +- scripts/update-nvim-plugins | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 scripts/update-nvim-plugins diff --git a/justfile b/justfile index 4b99917..33b1ed8 100644 --- a/justfile +++ b/justfile @@ -15,7 +15,7 @@ zls-git install-scripts target=(`echo $HOME` + "/.local"): ln -sf \ - `pwd`/scripts/{map-touch-display,start-joshuto,withjava,startriver} \ + `pwd`/scripts/{map-touch-display,start-joshuto,withjava,startriver,update-nvim-plugins} \ {{target}}/bin cd scripts/randomwallpaper && zig build -Doptimize=ReleaseFast -p {{target}} diff --git a/scripts/update-nvim-plugins b/scripts/update-nvim-plugins new file mode 100755 index 0000000..8ef7288 --- /dev/null +++ b/scripts/update-nvim-plugins @@ -0,0 +1,19 @@ +#!/usr/bin/env racket +#lang racket + +;; Updates the neovim plugins +;; Packer is currently too dumb to do this is the plugins have been compiled + +(define plugin-dir (expand-user-path "~/.local/share/nvim/site/pack/packer")) + +(define dirs + (map (λ (path) (match-let-values ([(p _ _) (split-path path)]) p)) + (find-files (λ (path) (equal? (path->string (last (explode-path path))) ".git")) plugin-dir))) + +(define git-path (find-executable-path "git")) + +(for ([dir (in-list dirs)]) + (let ([name (last (explode-path dir))]) (printf "\n====== ~a ======\n\n" name)) + (parameterize ([current-directory dir]) + (system* git-path "checkout" "." #:set-pwd? #t) + (system* git-path "pull" #:set-pwd? #t)))