From 098fd7b994bb1c9953de0e303ca9fa5d07916579 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 21 Apr 2026 01:23:28 +0100 Subject: feat: add 'just remove' to drop packages from a group and uninstall --- justfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'justfile') diff --git a/justfile b/justfile index 2345d22..86d8c4a 100644 --- a/justfile +++ b/justfile @@ -157,6 +157,26 @@ add group +pkgs: paru -S --needed {{ pkgs }} +# Remove one or more packages from a group list and uninstall them (e.g. just remove dev ripgrep fd) +remove group +pkgs: + #!/bin/sh + set -eu + file="meta/{{ group }}.txt" + if [ ! -f "$file" ]; then + echo "error: $file does not exist" >&2 + exit 1 + fi + for pkg in {{ pkgs }}; do + if grep -qxF "$pkg" "$file"; then + sed -i "/^$(printf '%s' "$pkg" | sed 's/[]\/$*.^[]/\\&/g')\$/d" "$file" + echo "removed $pkg from {{ group }}.txt" + else + echo "$pkg not in {{ group }}.txt" + fi + done + paru -Rsn {{ pkgs }} + + # ═══════════════════════════════════════════════════════════════════ # Hidden helpers (run indirectly via the recipes above) # ═══════════════════════════════════════════════════════════════════ -- cgit v1.2.3-70-g09d2