5 releases
0.2.1 | Jan 19, 2025 |
---|---|
0.2.0 | Jan 19, 2025 |
0.1.2 | Jan 15, 2025 |
0.1.1 | Jan 4, 2025 |
0.1.0 | Jan 4, 2025 |
#201 in Filesystem
366 downloads per month
82KB
288 lines
swim-clean-all
swim
subcommand inspired by the amazing
cargo-clean-all
for Rust
(although they probably have a better implementation than the hacky code I
wrote!).
You can even set a config file to, for example, automatically skip certain directories.
🚀 Showcase
⚡️ Requirements
Make sure you have swim
installed.
That's it!
📦 Install
Install from crates.io:
cargo install swim-clean-all
(Sorry, no cargo binstall
magic yet.)
✨ Usage
$ swim clean-all --help
Usage: swim-clean-all [<search_root>] [--skip <skip...>] [--max-depth <max-depth>] [--config <config>] [--ignore-config] [--verbose]
Recursively clean all swim projects in a given directory that match the specified criteria
Positional Arguments:
search_root the root directory to recursively search for swim projects;
defaults to the cwd
Options:
--skip directories to skip when traversing
--max-depth maximum depth search limit; defaults to 100
--config manually specify a config path, e.g., foo.toml
--ignore-config do not load and extend the config file
--verbose print debugging information
--help, help display usage information
Note that cleaning a project will erase the entire build folder instead of
calling swim clean
-- I will add support for this customization if requested.
Config File
This subcommand searches for a file named swim-clean-all.toml
:
- under the directory given in the environment variable
XDG_CONFIG_HOME
, if specified; - under the standard location for each operating system (the following table is
reproduced from this documentation for a user named "Alice");
Platform Value Example Linux $XDG_CONFIG_HOME
or$HOME
/.config/home/alice/.config macOS $HOME
/Library/Application Support/Users/Alice/Library/Application Support Windows {FOLDERID_LocalAppData}
C:\Users\Alice\AppData\Local - as a last resort, under
~/.config
Refer to the definition of struct Config
in the source code:
# swim-clean-all.toml
# these are NOT the defaults
skip = ["~/Library"]
max-depth = 50
Dependencies
~8–17MB
~224K SLoC