mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-12 04:52:53 +01:00
30 lines
878 B
Racket
Executable file
30 lines
878 B
Racket
Executable file
#!/usr/bin/env racket
|
|
#lang racket
|
|
|
|
(current-print void)
|
|
|
|
(define noint (make-parameter #f))
|
|
(command-line #:program "sysupdate"
|
|
#:usage-help "Update the system"
|
|
#:once-each [("-n" "--noint") "Don't require user interaction" (noint #t)])
|
|
|
|
(define failures '())
|
|
|
|
(define (cmd exe . args)
|
|
(match* ((find-executable-path exe) (cons exe args))
|
|
[(#f argv) (printf "skipping command ~a, command not found\n" argv)]
|
|
[(exepath argv)
|
|
(printf ">>> ~a\n" argv)
|
|
(unless (apply system* exepath args)
|
|
(set! failures (cons argv failures)))]))
|
|
|
|
(cmd "zupper" "update")
|
|
(cmd "rustup" "update")
|
|
(apply cmd (if (noint)
|
|
'("paru" "-Syu" "--noconfirm")
|
|
'("paru" "-Syu")))
|
|
(cmd "update-nvim-plugins")
|
|
(cmd "tldr" "--update")
|
|
|
|
(unless (empty? failures)
|
|
(raise-user-error "The following commands failed:" failures))
|