Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(cn): add document for Running tasks in parallel in CN #2424

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.中文.md
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,19 @@ foo $argument:

- [`watchexec`](https://github.com/mattgreen/watchexec) — 一个简单的工具,它监控一个路径,并在检测到修改时运行一个命令。

### 并行运行任务

GNU parallel 可以用来同时运行多个任务:

```just
parallel:
#!/usr/bin/env -S parallel --shebang --ungroup --jobs {{ num_cpus() }}
echo task 1 start; sleep 3; echo task 1 done
echo task 2 start; sleep 3; echo task 2 done
echo task 3 start; sleep 3; echo task 3 done
echo task 4 start; sleep 3; echo task 4 done
```

### Shell 别名

为了快速运行命令, 可以把 `alias j=just` 放在你的 Shell 配置文件中。
Expand Down