#shell #run-command #subdirectories #asynchronous #filtered #name #git

app asyncrun

Asynchronously execute shell commands in filtered subdirectories

6 releases

new 0.0.6 Sep 6, 2024
0.0.5 Aug 25, 2024

#108 in Filesystem

Download history 291/week @ 2024-08-18 121/week @ 2024-08-25 98/week @ 2024-09-01

510 downloads per month

MIT license

200KB
122 lines

Contributors Forks Stargazers Issues MIT License


Logo

async_run

Asynchronously execute shell commands in filtered subdirectories.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

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".

(back to top)

Built With

  • Rust

(back to top)

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

  1. Clone the repo
    git clone https://github.com/kingwingfly/asyncrun.git
    
  2. Compilation
    cargo build --release
    

(back to top)

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

(back to top)

Roadmap

  • Feature

See the open issues for a full list of proposed features (and known issues).

(back to top)

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Louis - 836250617@qq.com

Project Link: https://github.com/kingwingfly/asyncrun

(back to top)

Acknowledgments

(back to top)

Dependencies

~5–14MB
~150K SLoC