6 releases
0.0.6 | Sep 6, 2024 |
---|---|
0.0.5 | Aug 25, 2024 |
#2724 in Command line utilities
200KB
122 lines
async_run
Asynchronously execute shell commands in filtered subdirectories.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
Do things like find . -type d -name ".git" | xargs -I _ -P 64 sh -c "cd _/.. && git pull --rebase &> /dev/tty"
easier if you're not a unix-pro guy.
Instead, just asyncrun -e .git -- "git pull --rebase"
.
Built With
Getting Started
Download at release page. Or
cargo install asyncrun
Or compile yourself:
Prerequisites
- Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Compilation
- Clone the repo
git clone https://github.com/kingwingfly/asyncrun.git
- Compilation
cargo build --release
Usage
Asynchronously execute shell commands in filtered subdirectories
Usage: asyncrun [OPTIONS] [PATH] -- <COMMANDS>...
Arguments:
[PATH] Path to search for directories [default: /Users/louis/rust/asyncrun]
<COMMANDS>... Commands to run in each directory
Options:
-e <EXIST> Filter by file/dir names all exist
-E <NOT_EXIST> Filter by file/dir names all non-exist
-n <ASYNC_NUM> Number of async commands to run concurrently [default: 1024]
-h, --help Print help
-V, --version Print version
Example
asyncrun -e .git -- "git fetch -p" "git pull --rebase" "git gc"
asyncrun -e .git -e Cargo.toml -- "cargo update" "git add ." "git commit -m 'update deps'" "git push"
asyncrun -e Cargo.toml -e target -- "cargo clean"
asyncrun -e .git -e .DS_Store -e .gitignore -- "git pull --rebase" "rm .DS_Store" "git add ." "git commit -m 'rm .DS_Store'" "grep -qxF '.DS_Store' .gitignore || echo '.DS_Store' >> .gitignore" "git add ." "git commit -m 'modified .gitignore'" "git push" | tee output.txt
Roadmap
- Feature
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Contact
Louis - 836250617@qq.com
Project Link: https://github.com/kingwingfly/asyncrun
Acknowledgments
Dependencies
~5–13MB
~150K SLoC