add update-nvim-plugins script

This commit is contained in:
LordMZTE 2023-02-16 20:58:07 +01:00
parent 497bb42565
commit cb431ee1a0
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
2 changed files with 20 additions and 1 deletions

View File

@ -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}}

19
scripts/update-nvim-plugins Executable file
View File

@ -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)))