-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented run once attribute for required tasks (#83)
* feat: implemented run once attribute for required tasks * feat: update already ran message * chore: build documentation for run attribute
- Loading branch information
Showing
8 changed files
with
193 additions
and
13 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
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,48 @@ | ||
--- | ||
title: "Run" | ||
description: | ||
linkTitle: "Run" | ||
menu: { main: { parent: 'task-syntax', weight: 10 } } | ||
--- | ||
|
||
## Run attribute | ||
|
||
By default, a task can run as many times as it appears in the requires tree. | ||
Consider a scenario where a task is required to run only one time per `xc` invocation, | ||
regardless of how many times it is required. | ||
|
||
The solution would be to set the `run` attribute to `once` (defaults to `always`). | ||
|
||
````markdown | ||
### setup | ||
|
||
run: once | ||
|
||
``` | ||
echo "TASK 3" | ||
``` | ||
```` | ||
|
||
This will result in the task only running the first time it is invoked. | ||
|
||
The default is `always`, which can be omitted or specified. | ||
|
||
````markdown | ||
### setup | ||
|
||
``` | ||
echo "TASK 3" | ||
``` | ||
```` | ||
|
||
is the same as | ||
|
||
````markdown | ||
### setup | ||
|
||
run: always | ||
|
||
``` | ||
echo "TASK 3" | ||
``` | ||
```` |
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
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