5 个版本

0.1.0 2024年7月31日
0.0.7 2024年7月25日
0.0.5 2024年4月19日

#308并发

Download history 157/week @ 2024-04-16 8/week @ 2024-04-23 5/week @ 2024-05-21 2/week @ 2024-05-28 228/week @ 2024-07-23 183/week @ 2024-07-30

每月 411 次下载

MIT 许可证

14KB
284

🍺 运行 —

Run 是一个命令行工具,可以同时执行多个目录中的命令。它利用并行处理和并发 I/O 来高效地在目录间运行任务。

基准测试

命令 时间
find -iname .git -execdir ls \;
real    0m14.476s
user    0m5.260s
sys     0m7.526s
Run -P .git ls
real    0m7.194s
user    0m0.030s
sys     0m0.045s
find -iname .git -type d -execdir git status \;
real    1m1.242s
user    0m4.080s
sys     0m6.354s
Run -P .git git status
real    0m21.947s
user    0m0.045s
sys     0m0.031s

安装

cargo install prun

使用

Run .git git fetch upstream

此命令将从上游获取当前目录内所有 .git 仓库的内容。它实际上替换了以下命令

find -iname .git -type d -execdir git fetch upstream \;

选项

--File 或 -F

限制执行匹配特定模式的文件

Run -F astro.config.ts npx astro add @playform/compress

--Root 或 -R

将当前工作目录设置为不同的文件夹(默认为 .

Run -R D:\Developer .git git fetch upstream

--Parallel 或 -P

并行运行命令(默认为 sequential

Run -P -R D:\Developer .git git fetch upstream

--Exclude

排除某些文件或目录(默认为 node_modules .git target dist vendor

--Pattern

指定自定义匹配模式

依赖项

Run 依赖于几个 Rust Crates 来提供其功能

  • clap - 解析命令行参数
  • rayon - 启用并行处理
  • tokio - 提供异步运行时
  • walkdir - 促进高效的文件系统遍历

变更日志

有关此 CLI 的变更历史,请参阅 CHANGELOG.md

依赖项

~5–15MB
~172K SLoC