diff --git a/justfile b/justfile index 05557181a..d408fe756 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.*'