From b86d864a6950214babba8bb0c627392782846d36 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sun, 10 Oct 2021 20:33:16 +0200 Subject: [PATCH] add upgr config --- .config/upgr/config.toml | 15 ++++++++++++++ scripts/sysupdate | 42 ---------------------------------------- 2 files changed, 15 insertions(+), 42 deletions(-) create mode 100644 .config/upgr/config.toml delete mode 100755 scripts/sysupdate diff --git a/.config/upgr/config.toml b/.config/upgr/config.toml new file mode 100644 index 0000000..483b2eb --- /dev/null +++ b/.config/upgr/config.toml @@ -0,0 +1,15 @@ +[[steps]] +command = ["nvim", "+:PackerSync", "+:CocUpdate", "+:TSUpdate"] +interactive = true + +[[steps]] +command = ["paru", "-Syu"] +unint_alt = ["paru", "-Syu", "--noconfirm"] +interactive = true + +[[steps]] +command = ["rustup", "update"] + +[[steps]] +command = ["fw", "sync"] + diff --git a/scripts/sysupdate b/scripts/sysupdate deleted file mode 100755 index 92de037..0000000 --- a/scripts/sysupdate +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env scriptisto - -(* - scriptisto-begin - script_src: sysupdate.ml - build_cmd: dune build sysupdate.exe - target_bin: ./_build/default/sysupdate.exe - files: - - path: dune - content: (executable (name sysupdate) (libraries clap unix)) - scriptisto-end -*) -let run cmd = - let splits = String.split_on_char ' ' cmd in - let pipe = Unix.open_process_in ("which " ^ (List.nth splits 0)) in - let status = Unix.close_process_in pipe in - match status with - | Unix.WEXITED 0 -> - let sep_string = String.make (8 + String.length cmd) '=' in - Stdlib.print_endline sep_string; - Stdlib.print_endline ("Running \u{001b}[32m" ^ cmd ^ "\u{001b}[0m"); - Stdlib.print_endline sep_string; - let status = Sys.command cmd in - if status != 0 then - raise - (Failure - (String.concat " " - [ "Command"; cmd; "exited with code"; string_of_int status ])) - | _ -> - String.concat " " [ "Command"; cmd; "not found." ] |> Stdlib.print_endline - -let () = - Clap.description "Update the system"; - let background = Clap.flag ~set_long:"background" ~set_short:'b' false in - Clap.close (); - - if not background then - run "nvim '+:PackerSync' '+:CocUpdate' '+:TSUpdate'"; - - run "paru -Syu --noconfirm"; - run "rustup update"; - run "fw sync"