From 582e9d70930e086a3db74aa7f4ef35c50510c961 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 17 Oct 2026 13:24:51 -0500 Subject: [PATCH] Just(chore): Clean ignored build output why: .gitignore already names rebuildable output. A shell rm list drifts across Windows and Unix, and git clean -x keeps only positive -e patterns, so a negated .env exclude still deletes .env. what: - Add clean and clean-dry with git clean -fdX, keeping .env - Add nuke with git clean -fdx and a confirm prompt, naming .env so it stays --- justfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/justfile b/justfile index 05557181a6..d408fe7562 100644 --- a/justfile +++ b/justfile @@ -137,3 +137,21 @@ _entr-warn: @echo "Install entr(1) to automatically run tasks on file change." @echo "See https://eradman.com/entrproject/ " @echo "----------------------------------------------------------" + + +# Remove ignored build artifacts and caches. Untracked files and .env stay. +[group: 'clean'] +clean: + git clean -fdX -e '!.env' -e '!.env.*' + +# Preview what clean will delete. +[group: 'clean'] +clean-dry: + git clean -ndX -e '!.env' -e '!.env.*' + +# Remove ignored and untracked files. .env and .env.* stay. +# git clean -x ignores .gitignore and only preserves -e patterns, so .env is named here rather than negated. +[group: 'clean'] +[confirm("This will delete all untracked and ignored files. Continue?")] +nuke: + git clean -fdx -e '.env' -e '.env.*'