Clean up your packages as oneshot.
janitor will clean ups...
vendor/node_modules/.venvvenv/env/
By default, matching directories are moved to Trash (not permanently deleted).
brew tap b4moss/tap
brew install b4moss/tap/janitor
# clean up recursively from current directory (move to Trash)
janitor .
# When you hit this command, janitor will count up target directories and total filesize.
# Finally, will ask you really do it or not.
# execute specific directory
janitor /path/to/directory
# print version
janitor --version
# dry run (no move / no delete)
janitor . --dry-run
# permanently delete instead of moving to Trash
janitor . --force
# exclude paths matching a regex (repeatable)
janitor . --ignore 'keep-me'
janitor . --ignore 'project-a' --ignore 'vendor/legacy'# clone
git clone https://github.com/b4moss/janitor
cd janitor
# setup
chmod +x ./src/janitor.sh
# execute
./src/janitor.sh .
# dry run
./src/janitor.sh . --dry-run
# execute specific directory
./src/janitor.sh /path/to/directory- macOS:
~/.Trash - Linux:
~/.local/share/Trash/files - If the Trash directory does not exist, janitor exits with an error and suggests
--force. --forcepermanently deletes withrm -rf(confirmation prompt still appears).--dry-runnever moves or deletes.
--ignore REGEX matches against the full found path (ERE-like). Pass the option multiple times to apply multiple patterns. Ignored paths are listed as [skip].
On first run (or janitor config show), janitor creates ~/.config/janitor/config.json.
janitor config showDefault shape (see schema/config.schema.json):
{
"version": 1,
"targets": ["node_modules", "vendor", ".venv", "venv", "env"],
"ignore": [],
"trash_dir": null,
"default_action": "trash",
"confirm": true
}Priority: CLI > env (JANITOR_TRASH_DIR) > config > built-in defaults.
targets: replaces the built-in listignore: merged with CLI--ignoredefault_action:"trash"or"force"confirm:falseskips the prompt
Override config location with JANITOR_CONFIG_DIR or JANITOR_CONFIG_PATH (useful for tests).
bats tests/LICENSE: MIT LICENSE
by B4M LLC.