-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to run dependencies asynchronously (#106)
* Add option to run dependencies asynchronously * Document runDeps task attribute * Do not cancel other async deps on error * Add log prefix to all scripts The prefixes are padded with spaces when the task has dependencies * Fix bug when an attribute is on the last line * Fix lint issues * Add tests for prefix logger * Add deps behaviour to task display * Add interactive attribute to disable log prefixing
- Loading branch information
1 parent
e7cbab8
commit 01aa6e0
Showing
13 changed files
with
479 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: "Interactive" | ||
description: | ||
linkTitle: "Interactive" | ||
menu: { main: { parent: "task-syntax", weight: 12 } } | ||
--- | ||
|
||
## Interactive attribute | ||
|
||
By default, the logs of a task are prefixed with the task name. This does not work well for interactive tasks which usually require complete control over the terminal. | ||
If you want to run a task interactively, you can set the `interactive` attribute to `true`. | ||
|
||
```markdown | ||
### configure | ||
|
||
interactive: true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: "Run Dependencies" | ||
description: | ||
linkTitle: "RunDeps" | ||
menu: { main: { parent: "task-syntax", weight: 11 } } | ||
--- | ||
|
||
## RunDeps attribute | ||
|
||
By default, the dependencies of a task are run sequentially, in the order they are listed. | ||
However we may prefer for all the dependencies of a task to be run in paralled. | ||
|
||
The solution would be to set the `runDeps` attribute to `async` (defaults to `sync`). | ||
|
||
```markdown | ||
### build-all | ||
|
||
requires: build-js, build-css | ||
runDeps: async | ||
``` | ||
|
||
This will result in both `build-js` and `build-css` being run in parallel. | ||
|
||
The default is `sync`, which can be omitted or specified. | ||
|
||
```markdown | ||
### build-all | ||
|
||
requires: build-js, build-css | ||
runDeps: sync | ||
``` | ||
|
||
is the same as | ||
|
||
```markdown | ||
### build-all | ||
|
||
requires: build-js, build-css | ||
runDeps: sync | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# My readme | ||
|
||
## Tasks | ||
|
||
### generate-templ | ||
|
||
```bash | ||
go run -mod=mod github.com/a-h/templ/cmd/templ generate | ||
go mod tidy | ||
``` | ||
|
||
### generate-translations | ||
|
||
```bash | ||
go run ./i18n/generate | ||
``` | ||
|
||
### generate-all | ||
|
||
Requires: generate-templ, generate-translations | ||
RunDeps: async |
Oops, something went wrong.