Crates.io | loop_cmd |
lib.rs | loop_cmd |
version | 0.1.16 |
source | src |
created_at | 2024-07-25 03:25:41.218332 |
updated_at | 2024-07-25 03:25:41.218332 |
description | A command-line tool for executing commands across multiple directories |
homepage | https://github.com/mateodelnorte/loop_cmd |
repository | https://github.com/mateodelnorte/loop_cmd |
max_upload_size | |
id | 1314631 |
size | 60,284 |
loop
is a simple, but powerful command-line tool that allows you to execute commands in multiple directories simultaneously. It's designed to simplify batch operations across multiple projects or subdirectories, making it an essential tool for developers managing complex project structures.
You can install loop
using the following command:
curl -fsSL https://raw.githubusercontent.com/mateodelnorte/loop_cmd/main/install.sh | sh
This will download and install loop
so that it can be used as a command from your PATH.
Execute a command in all immediate subdirectories:
loop "git status"
Execute a command only in specified directories:
loop "npm install" --include dir1 dir2
Execute a command in all subdirectories except specified ones:
loop "cargo build" --exclude target node_modules
Include directories matching a pattern:
loop "yarn test" --include-pattern "app-"
Exclude directories matching a pattern:
loop "make clean" --exclude-pattern "-old"
Create a .looprc
configuration file in your current directory:
loop --init
The above will create a .looprc
file in your current directory similar to the following:
{
"ignore": [
".git"
]
}
This file can be used to set default options for the loop
command. The above file, for instance, will automatically apply --ignore .git .vagrant .vscode target
to all commands run using loop
within the directory containing the file.
You can create a .looprc
file in your current directory to set default options. Use loop --init
to create a template configuration file.
loop "git pull origin main"
loop "npm test" --include-pattern "*-js"
loop "make clean" --exclude build node_modules
loop "pip install -r requirements.txt --upgrade" --include-pattern "py-*"
Contributions are welcome! Please feel free to submit a Pull Request.