1
0
mirror of https://github.com/go-task/task.git synced 2025-01-18 04:59:01 +02:00

Website: Sync translations (#1093)

This commit is contained in:
task-bot 2023-03-30 22:25:31 -03:00 committed by GitHub
parent 451a3773c3
commit a729ee6fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 7291 additions and 194 deletions

396
docs/i18n/pt-BR/code.json Normal file
View File

@ -0,0 +1,396 @@
{
"theme.ErrorPageContent.title": {
"message": "This page crashed.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Try again",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Page Not Found",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "We could not find what you were looking for.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "danger",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "info",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "caution",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Scroll back to top",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archive",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archive",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Blog list page navigation",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Newer Entries",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Older Entries",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Blog post page navigation",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Newer Post",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Older Post",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "One post|{count} posts",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} tagged with \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "View All Tags",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Switch between dark and light mode (currently {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "dark mode",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "light mode",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Home page",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Docs pages navigation",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Previous",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Next",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} with \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Version: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Edit this page",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Direct link to heading",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " on {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " by {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Last updated{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versions",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Tags:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Close",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Blog recent posts navigation",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copied",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copy code to clipboard",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copy",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Languages",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "On this page",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Read More",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Read more about {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "One min read|{readingTime} min read",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Back to main menu",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchBar.seeAll": {
"message": "See all {count} results"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "One document found|{count} documents found",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Type your search here",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "Search",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Search by Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "No results were found",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Fetching new results...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "Search",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "Clear the query",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "Cancel",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "Recent",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "No recent searches",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "Save this search",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "Remove this search from history",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "Favorite",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "Remove this search from favorites",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "Unable to fetch results",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "You might want to check your network connection.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "to select",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Enter key",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "to navigate",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "Arrow up",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "Arrow down",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "to close",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Escape key",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "Search by",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "No results for",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "Try searching for",
"description": "The text for the suggested query when no results are found for the following search"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
"message": "Believe this query should return results?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "Let us know.",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "Search docs",
"description": "The placeholder of the input of the DocSearch pop-up modal"
},
"theme.common.skipToMainContent": {
"message": "Skip to main content",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Tags",
"description": "The title of the tag list page"
}
}

View File

@ -0,0 +1,5 @@
andreynering:
name: Andrey Nering
title: Maintainer of Task
url: https://github.com/andreynering
image_url: https://github.com/andreynering.png

View File

@ -0,0 +1,10 @@
{
"version.label": {
"message": "Next",
"description": "The label for version current"
},
"sidebar.tutorialSidebar.link.Chinese | 中国人": {
"message": "Chinese | 中国人",
"description": "The label for link Chinese | 中国人 in sidebar tutorialSidebar, linking to https://task-zh.readthedocs.io/zh_CN/latest/"
}
}

View File

@ -0,0 +1,291 @@
---
slug: /api/
sidebar_position: 4
toc_min_heading_level: 2
toc_max_heading_level: 5
---
# API Reference
## CLI
Task command line tool has the following syntax:
```bash
task [--flags] [tasks...] [-- CLI_ARGS...]
```
:::tip
If `--` is given, all remaning arguments will be assigned to a special `CLI_ARGS` variable
:::
| Short | Flag | Type | Default | Description |
| ----- | --------------------------- | -------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. |
| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. |
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. |
| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. |
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
| | `--json` | `bool` | `false` | See [JSON Output](#json-output) |
| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. |
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
| | `--summary` | `bool` | `false` | Show summary about a task. |
| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | |
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
| | `--version` | `bool` | `false` | Show Task version. |
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. |
## JSON Output
When using the `--json` flag in combination with either the `--list` or `--list-all` flags, the output will be a JSON object with the following structure:
```jsonc
{
"tasks": [
{
"name": "",
"desc": "",
"summary": "",
"up_to_date": false,
"location": {
"line": 54,
"column": 3,
"taskfile": "/path/to/Taskfile.yml"
}
},
// ...
],
"location": "/path/to/Taskfile.yml"
}
```
## Special Variables
There are some special variables that is available on the templating system:
| Var | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. |
| `TASK` | The name of the current task. |
| `ROOT_DIR` | The absolute path of the root Taskfile. |
| `TASKFILE_DIR` | The absolute path of the included Taskfile. |
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
| `TIMESTAMP` | The date object of the greatest timestamp of the files listes in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
| `TASK_VERSION` | The current version of task. |
## ENV
Some environment variables can be overriden to adjust Task behavior.
| ENV | Default | Description |
| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `TASK_TEMP_DIR` | `.task` | Location of the temp dir. Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
| `TASK_COLOR_RESET` | `0` | Color used for white. |
| `TASK_COLOR_BLUE` | `34` | Color used for blue. |
| `TASK_COLOR_GREEN` | `32` | Color used for green. |
| `TASK_COLOR_CYAN` | `36` | Color used for cyan. |
| `TASK_COLOR_YELLOW` | `33` | Color used for yellow. |
| `TASK_COLOR_MAGENTA` | `35` | Color used for magenta. |
| `TASK_COLOR_RED` | `31` | Color used for red. |
| `FORCE_COLOR` | | Force color output usage. |
## Taskfile Schema
| Attribute | Type | Default | Description |
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
### Include
| Attribute | Type | Default | Description |
| ---------- | --------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
:::info
Informing only a string like below is equivalent to setting that value to the `taskfile` attribute.
```yaml
includes:
foo: ./path
```
:::
### Variable
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------ |
| *itself* | `string` | | A static value that will be set to the variable. |
| `sh` | `string` | | A shell command. The output (`STDOUT`) will be assigned to the variable. |
:::info
Static and dynamic variables have different syntaxes, like below:
```yaml
vars:
STATIC: static
DYNAMIC:
sh: echo "dynamic"
```
:::
### Task
| Attribute | Type | Default | Description |
| --------------- | ---------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the task should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/master/src/go/build/syslist.go). Task will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
These alternative syntaxes are available. They will set the given values to `cmds` and everything else will be set to their default values:
```yaml
tasks:
foo: echo "foo"
foobar:
- echo "foo"
- echo "bar"
baz:
cmd: echo "baz"
```
:::
#### Command
| Attribute | Type | Default | Description |
| -------------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmd` | `string` | | The shell command to be executed. |
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the command should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/master/src/go/build/syslist.go). Command will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
If given as a a string, the value will be assigned to `cmd`:
```yaml
tasks:
foo:
cmds:
- echo "foo"
- echo "bar"
```
:::
#### Dependency
| Attribute | Type | Default | Description |
| --------- | ---------------------------------- | ------- | -------------------------------------------------------- |
| `task` | `string` | | The task to be execute as a dependency. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
:::tip
If you don't want to set additional variables, it's enough to declare the dependency as a list of strings (they will be assigned to `task`):
```yaml
tasks:
foo:
deps: [foo, bar]
```
:::
#### Precondition
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `sh` | `string` | | Command to be executed. If a non-zero exit code is returned, the task errors without executing its commands. |
| `msg` | `string` | | Optional message to print if the precondition isn't met. |
:::tip
If you don't want to set a different message, you can declare a precondition like this and the value will be assigned to `sh`:
```yaml
tasks:
foo:
precondition: test -f Taskfile.yml
```
:::

View File

@ -0,0 +1,455 @@
---
slug: /changelog/
sidebar_position: 7
---
# Changelog
## v3.23.0 - 2023-03-26
Task now has an [official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task) contributed by [@pd93](https://github.com/pd93)! :tada: The extension is maintained in a [new repository](https://github.com/go-task/vscode-task) under the `go-task` organization. We're looking to gather feedback from the community so please give it a go and let us know what you think via a [discussion](https://github.com/go-task/vscode-task/discussions), [issue](https://github.com/go-task/vscode-task/issues) or on our [Discord](https://discord.gg/6TY36E39UK)!
> **NOTE:** The extension _requires_ v3.23.0 to be installed in order to work.
- The website was integrated with [Crowdin](https://crowdin.com/project/taskfile) to allow the community to contribute with translations! [Chinese](https://taskfile.dev/zh-Hans/) is the first language available ([#1057](https://github.com/go-task/task/issues/1057), [#1058](https://github.com/go-task/task/issues/1058) by [@misitebao](https://github.com/misitebao)).
- Added task location data to the `--json` flag output ([#1056](https://github.com/go-task/task/issues/1056) by [@pd93](https://github.com/pd93))
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to `Taskfile.yml` ([#1062](https://github.com/go-task/task/issues/1062) by [@misitebao](https://github.com/misitebao)).
- Added new `splitArgs` template function (`{{splitArgs "foo bar 'foo bar
baz'"}}`) to ensure string is split as arguments ([#1040](https://github.com/go-task/task/issues/1040), [#1059](https://github.com/go-task/task/issues/1059) by [@dhanusaputra](https://github.com/dhanusaputra)).
- Fix the value of `{{.CHECKSUM}}` variable in status ([#1076](https://github.com/go-task/task/issues/1076), [#1080](https://github.com/go-task/task/issues/1080) by [@pd93](https://github.com/pd93)).
- Fixed deep copy implementation ([#1072](https://github.com/go-task/task/issues/1072) by [@pd93](https://github.com/pd93))
- Created a tool to assist with releases ([#1086](https://github.com/go-task/task/issues/1086) by [@pd93](https://github.com/pd93)).
## v3.22.0 - 2023-03-10
- Add a brand new `--global` (`-g`) flag that will run a Taskfile from your `$HOME` directory. This is useful to have automation that you can run from anywhere in your system! ([Documentation](https://taskfile.dev/usage/#running-a-global-taskfile), [#1029](https://github.com/go-task/task/issues/1029) by [@andreynering](https://github.com/andreynering)).
- Add ability to set `error_only: true` on the `group` output mode. This will instruct Task to only print a command output if it returned with a non-zero exit code ([#664](https://github.com/go-task/task/issues/664), [#1022](https://github.com/go-task/task/issues/1022) by [@jaedle](https://github.com/jaedle)).
- Fixed bug where `.task/checksum` file was sometimes not being created when task also declares a `status:` ([#840](https://github.com/go-task/task/issues/840), [#1035](https://github.com/go-task/task/issues/1035) by [@harelwa](https://github.com/harelwa), [#1037](https://github.com/go-task/task/issues/1037) by [@pd93](https://github.com/pd93)).
- Refactored and decoupled fingerprinting from the main Task executor ([#1039](https://github.com/go-task/task/issues/1039) by [@pd93](https://github.com/pd93)).
- Fixed deadlock issue when using `run: once` ([#715](https://github.com/go-task/task/issues/715), [#1025](https://github.com/go-task/task/issues/1025) by [@theunrepentantgeek](https://github.com/theunrepentantgeek)).
## v3.21.0 - 2023-02-22
- Added new `TASK_VERSION` special variable ([#990](https://github.com/go-task/task/issues/990), [#1014](https://github.com/go-task/task/issues/1014) by [@ja1code](https://github.com/ja1code)).
- Fixed a bug where tasks were sometimes incorrectly marked as internal ([#1007](https://github.com/go-task/task/issues/1007) by [@pd93](https://github.com/pd93)).
- Update to Go 1.20 (bump minimum version to 1.19) ([#1010](https://github.com/go-task/task/issues/1010) by [@pd93](https://github.com/pd93))
- Added environment variable `FORCE_COLOR` support to force color output. Usefull for environments without TTY ([#1003](https://github.com/go-task/task/issues/1003) by [@automation](https://github.com/automation)-stack)
## v3.20.0 - 2023-01-14
- Improve behavior and performance of status checking when using the `timestamp` mode ([#976](https://github.com/go-task/task/issues/976), [#977](https://github.com/go-task/task/issues/977) by [@aminya](https://github.com/aminya)).
- Performance optimizations were made for large Taskfiles ([#982](https://github.com/go-task/task/issues/982) by [@pd93](https://github.com/pd93)).
- Add ability to configure options for the [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) and [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) builtins ([#908](https://github.com/go-task/task/issues/908), [#929](https://github.com/go-task/task/issues/929) by [@pd93](https://github.com/pd93), [Documentation](http://taskfile.dev/usage/#set-and-shopt)).
- Add new `platforms:` attribute to `task` and `cmd`, so it's now possible to choose in which platforms that given task or command will be run on. Possible values are operating system (GOOS), architecture (GOARCH) or a combination of the two. Example: `platforms: [linux]`, `platforms: [amd64]` or `platforms:
[linux/amd64]`. Other platforms will be skipped ([#978](https://github.com/go-task/task/issues/978), [#980](https://github.com/go-task/task/issues/980) by [@leaanthony](https://github.com/leaanthony)).
## v3.19.1 - 2022-12-31
- Small bug fix: closing `Taskfile.yml` once we're done reading it ([#963](https://github.com/go-task/task/issues/963), [#964](https://github.com/go-task/task/issues/964) by [@HeCorr](https://github.com/HeCorr)).
- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file ([#961](https://github.com/go-task/task/issues/961), [#971](https://github.com/go-task/task/issues/971) by [@pd93](https://github.com/pd93)).
- Fixed a bug where watch intervals set in the Taskfile were not being respected ([#969](https://github.com/go-task/task/issues/969), [#970](https://github.com/go-task/task/issues/970) by [@pd93](https://github.com/pd93))
- Add `--json` flag (alias `-j`) with the intent to improve support for code editors and add room to other possible integrations. This is basic for now, but we plan to add more info in the near future ([#936](https://github.com/go-task/task/issues/936) by [@davidalpert](https://github.com/davidalpert), [#764](https://github.com/go-task/task/issues/764)).
## v3.19.0 - 2022-12-05
- Installation via npm now supports [pnpm](https://pnpm.io/) as well ([go-task/go-npm\[#2\](https://github.com/go-task/task/issues/2)](https://github.com/go-task/go-npm/issues/2), [go-task/go-npm\[#3\](https://github.com/go-task/task/issues/3)](https://github.com/go-task/go-npm/pull/3)).
- It's now possible to run Taskfiles from subdirectories! A new `USER_WORKING_DIR` special variable was added to add even more flexibility for monorepos ([#289](https://github.com/go-task/task/issues/289), [#920](https://github.com/go-task/task/issues/920)).
- Add task-level `dotenv` support ([#389](https://github.com/go-task/task/issues/389), [#904](https://github.com/go-task/task/issues/904)).
- It's now possible to use global level variables on `includes` ([#942](https://github.com/go-task/task/issues/942), [#943](https://github.com/go-task/task/issues/943)).
- The website got a brand new [translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by [\[@DeronW\](https://github.com/DeronW)](https://github.com/DeronW). Thanks!
## v3.18.0 - 2022-11-12
- Show aliases on `task --list --silent` (`task --ls`). This means that aliases will be completed by the completion scripts ([#919](https://github.com/go-task/task/issues/919)).
- Tasks in the root Taskfile will now be displayed first in `--list`/`--list-all` output ([#806](https://github.com/go-task/task/issues/806), [#890](https://github.com/go-task/task/issues/890)).
- It's now possible to call a `default` task in an included Taskfile by using just the namespace. For example: `docs:default` is now automatically aliased to `docs` ([#661](https://github.com/go-task/task/issues/661), [#815](https://github.com/go-task/task/issues/815)).
## v3.17.0 - 2022-10-14
- Add a "Did you mean ...?" suggestion when a task does not exits another one with a similar name is found ([#867](https://github.com/go-task/task/issues/867), [#880](https://github.com/go-task/task/issues/880)).
- Now YAML parse errors will print which Taskfile failed to parse ([#885](https://github.com/go-task/task/issues/885), [#887](https://github.com/go-task/task/issues/887)).
- Add ability to set `aliases` for tasks and namespaces ([#268](https://github.com/go-task/task/issues/268), [#340](https://github.com/go-task/task/issues/340), [#879](https://github.com/go-task/task/issues/879)).
- Improvements to Fish shell completion ([#897](https://github.com/go-task/task/issues/897)).
- Added ability to set a different watch interval by setting `interval: '500ms'` or using the `--interval=500ms` flag ([#813](https://github.com/go-task/task/issues/813), [#865](https://github.com/go-task/task/issues/865)).
- Add colored output to `--list`, `--list-all` and `--summary` flags ([#845](https://github.com/go-task/task/issues/845), [#874](https://github.com/go-task/task/issues/874)).
- Fix unexpected behavior where `label:` was being shown instead of the task name on `--list` ([#603](https://github.com/go-task/task/issues/603), [#877](https://github.com/go-task/task/issues/877)).
## v3.16.0 - 2022-09-29
- Add `npm` as new installation method: `npm i -g [@go](https://github.com/go)-task/cli` ([#870](https://github.com/go-task/task/issues/870), [#871](https://github.com/go-task/task/issues/871), [npm package](https://www.npmjs.com/package/[@go](https://github.com/go)-task/cli)).
- Add support to marking tasks and includes as internal, which will hide them from `--list` and `--list-all` ([#818](https://github.com/go-task/task/issues/818)).
## v3.15.2 - 2022-09-08
- Fix error when using variable in `env:` introduced in the previous release ([#858](https://github.com/go-task/task/issues/858), [#866](https://github.com/go-task/task/issues/866)).
- Fix handling of `CLI_ARGS` (`--`) in Bash completion ([#863](https://github.com/go-task/task/issues/863)).
- On zsh completion, add ability to replace `--list-all` with `--list` as already possible on the Bash completion ([#861](https://github.com/go-task/task/issues/861)).
## v3.15.0 - 2022-09-03
- Add new special variables `ROOT_DIR` and `TASKFILE_DIR`. This was a highly requested feature ([#215](https://github.com/go-task/task/issues/215), [#857](https://github.com/go-task/task/issues/857), [Documentation](https://taskfile.dev/api/#special-variables)).
- Follow symlinks on `sources` ([#826](https://github.com/go-task/task/issues/826), [#831](https://github.com/go-task/task/issues/831)).
- Improvements and fixes to Bash completion ([#835](https://github.com/go-task/task/issues/835), [#844](https://github.com/go-task/task/issues/844)).
## v3.14.1 - 2022-08-03
- Always resolve relative include paths relative to the including Taskfile ([#822](https://github.com/go-task/task/issues/822), [#823](https://github.com/go-task/task/issues/823)).
- Fix ZSH and PowerShell completions to consider all tasks instead of just the public ones (those with descriptions) ([#803](https://github.com/go-task/task/issues/803)).
## v3.14.0 - 2022-07-08
- Add ability to override the `.task` directory location with the `TASK_TEMP_DIR` environment variable.
- Allow to override Task colors using environment variables: `TASK_COLOR_RESET`, `TASK_COLOR_BLUE`, `TASK_COLOR_GREEN`, `TASK_COLOR_CYAN`, `TASK_COLOR_YELLOW`, `TASK_COLOR_MAGENTA` and `TASK_COLOR_RED` ([#568](https://github.com/go-task/task/issues/568), [#792](https://github.com/go-task/task/issues/792)).
- Fixed bug when using the `output: group` mode where STDOUT and STDERR were being print in separated blocks instead of in the right order ([#779](https://github.com/go-task/task/issues/779)).
- Starting on this release, ARM architecture binaries are been released to Snap as well ([#795](https://github.com/go-task/task/issues/795)).
- i386 binaries won't be available anymore on Snap because Ubuntu removed the support for this architecture.
- Upgrade mvdan.cc/sh, which fixes a bug with associative arrays ([#785](https://github.com/go-task/task/issues/785), [mvdan/sh\[#884\](https://github.com/go-task/task/issues/884)](https://github.com/mvdan/sh/issues/884), [mvdan/sh\[#893\](https://github.com/go-task/task/issues/893)](https://github.com/mvdan/sh/pull/893)).
## v3.13.0 - 2022-06-13
- Added `-n` as an alias to `--dry` ([#776](https://github.com/go-task/task/issues/776), [#777](https://github.com/go-task/task/issues/777)).
- Fix behavior of interrupt (SIGINT, SIGTERM) signals. Task will now give time for the processes running to do cleanup work ([#458](https://github.com/go-task/task/issues/458), [#479](https://github.com/go-task/task/issues/479), [#728](https://github.com/go-task/task/issues/728), [#769](https://github.com/go-task/task/issues/769)).
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the command being ran ([#755](https://github.com/go-task/task/issues/755)).
## v3.12.1 - 2022-05-10
- Fixed bug where, on Windows, variables were ending with `\r` because we were only removing the final `\n` but not `\r\n` ([#717](https://github.com/go-task/task/issues/717)).
## v3.12.0 - 2022-03-31
- The `--list` and `--list-all` flags can now be combined with the `--silent` flag to print the task names only, without their description ([#691](https://github.com/go-task/task/issues/691)).
- Added support for multi-level inclusion of Taskfiles. This means that included Taskfiles can also include other Taskfiles. Before this was limited to one level ([#390](https://github.com/go-task/task/issues/390), [#623](https://github.com/go-task/task/issues/623), [#656](https://github.com/go-task/task/issues/656)).
- Add ability to specify vars when including a Taskfile. [Check out the documentation](https://taskfile.dev/#/usage?id=vars-of-included-taskfiles) for more information ([#677](https://github.com/go-task/task/issues/677)).
## v3.11.0 - 2022-02-19
- Task now supports printing begin and end messages when using the `group` output mode, useful for grouping tasks in CI systems. [Check out the documentation](http://taskfile.dev/#/usage?id=output-syntax) for more information ([#647](https://github.com/go-task/task/issues/647), [#651](https://github.com/go-task/task/issues/651)).
- Add `Taskfile.dist.yml` and `Taskfile.dist.yaml` to the supported file name list. [Check out the documentation](https://taskfile.dev/#/usage?id=supported-file-names) for more information ([#498](https://github.com/go-task/task/issues/498), [#666](https://github.com/go-task/task/issues/666)).
## v3.10.0 - 2022-01-04
- A new `--list-all` (alias `-a`) flag is now available. It's similar to the exiting `--list` (`-l`) but prints all tasks, even those without a description ([#383](https://github.com/go-task/task/issues/383), [#401](https://github.com/go-task/task/issues/401)).
- It's now possible to schedule cleanup commands to run once a task finishes with the `defer:` keyword ([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer), [#475](https://github.com/go-task/task/issues/475), [#626](https://github.com/go-task/task/issues/626)).
- Remove long deprecated and undocumented `$` variable prefix and `^` command prefix ([#642](https://github.com/go-task/task/issues/642), [#644](https://github.com/go-task/task/issues/644), [#645](https://github.com/go-task/task/issues/645)).
- Add support for `.yaml` extension (as an alternative to `.yml`). This was requested multiple times throughout the years. Enjoy! ([#183](https://github.com/go-task/task/issues/183), [#184](https://github.com/go-task/task/issues/184), [#369](https://github.com/go-task/task/issues/369), [#584](https://github.com/go-task/task/issues/584), [#621](https://github.com/go-task/task/issues/621)).
- Fixed error when computing a variable when the task directory do not exist yet ([#481](https://github.com/go-task/task/issues/481), [#579](https://github.com/go-task/task/issues/579)).
## v3.9.2 - 2021-12-02
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains a fix a for a important regression on Windows ([#619](https://github.com/go-task/task/issues/619), [mvdan/sh\[#768\](https://github.com/go-task/task/issues/768)](https://github.com/mvdan/sh/issues/768), [mvdan/sh\[#769\](https://github.com/go-task/task/issues/769)](https://github.com/mvdan/sh/pull/769)).
## v3.9.1 - 2021-11-28
- Add logging in verbose mode for when a task starts and finishes ([#533](https://github.com/go-task/task/issues/533), [#588](https://github.com/go-task/task/issues/588)).
- Fix an issue with preconditions and context errors ([#597](https://github.com/go-task/task/issues/597), [#598](https://github.com/go-task/task/issues/598)).
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many ([#613](https://github.com/go-task/task/issues/613)).
- Fix nil pointer when `cmd:` was left empty ([#612](https://github.com/go-task/task/issues/612), [#614](https://github.com/go-task/task/issues/614)).
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant fixes:
- Fix quote of empty strings in `shellQuote` ([#609](https://github.com/go-task/task/issues/609), [mvdan/sh\[#763\](https://github.com/go-task/task/issues/763)](https://github.com/mvdan/sh/issues/763)).
- Fix issue of wrong environment variable being picked when there's another very similar one ([#586](https://github.com/go-task/task/issues/586), [mvdan/sh\[#745\](https://github.com/go-task/task/issues/745)](https://github.com/mvdan/sh/pull/745)).
- Install shell completions automatically when installing via Homebrew ([#264](https://github.com/go-task/task/issues/264), [#592](https://github.com/go-task/task/issues/592), [go-task/homebrew-tap\[#2\](https://github.com/go-task/task/issues/2)](https://github.com/go-task/homebrew-tap/pull/2)).
## v3.9.0 - 2021-10-02
- A new `shellQuote` function was added to the template system (`{{shellQuote "a
string"}}`) to ensure a string is safe for use in shell ([mvdan/sh\[#727\](https://github.com/go-task/task/issues/727)](https://github.com/mvdan/sh/pull/727), [mvdan/sh\[#737\](https://github.com/go-task/task/issues/737)](https://github.com/mvdan/sh/pull/737), [Documentation](https://pkg.go.dev/mvdan.cc/sh/v3[@v3](https://github.com/v3).4.0/syntax#Quote))
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with some small fixes and features
- The `read -p` flag is now supported ([#314](https://github.com/go-task/task/issues/314), [mvdan/sh\[#551\](https://github.com/go-task/task/issues/551)](https://github.com/mvdan/sh/issues/551), [mvdan/sh\[#772\](https://github.com/go-task/task/issues/772)](https://github.com/mvdan/sh/pull/722))
- The `pwd -P` and `pwd -L` flags are now supported ([#553](https://github.com/go-task/task/issues/553), [mvdan/sh\[#724\](https://github.com/go-task/task/issues/724)](https://github.com/mvdan/sh/issues/724), [mvdan/sh\[#728\](https://github.com/go-task/task/issues/728)](https://github.com/mvdan/sh/pull/728))
- The `$GID` environment variable is now correctly being set ([#561](https://github.com/go-task/task/issues/561), [mvdan/sh\[#723\](https://github.com/go-task/task/issues/723)](https://github.com/mvdan/sh/pull/723))
## v3.8.0 - 2021-09-26
- Add `interactive: true` setting to improve support for interactive CLI apps ([#217](https://github.com/go-task/task/issues/217), [#563](https://github.com/go-task/task/issues/563)).
- Fix some `nil` errors ([#534](https://github.com/go-task/task/issues/534), [#573](https://github.com/go-task/task/issues/573)).
- Add ability to declare an included Taskfile as optional ([#519](https://github.com/go-task/task/issues/519), [#552](https://github.com/go-task/task/issues/552)).
- Add support for including Taskfiles in the home directory by using `~` ([#539](https://github.com/go-task/task/issues/539), [#557](https://github.com/go-task/task/issues/557)).
## v3.7.3 - 2021-09-04
- Add official support to Apple M1 ([#564](https://github.com/go-task/task/issues/564), [#567](https://github.com/go-task/task/issues/567)).
- Our [official Homebrew tap](https://github.com/go-task/homebrew-tap) will support more platforms, including Apple M1
## v3.7.0 - 2021-07-31
- Add `run:` setting to control if tasks should run multiple times or not. Available options are `always` (the default), `when_changed` (if a variable modified the task) and `once` (run only once no matter what). This is a long time requested feature. Enjoy! ([#53](https://github.com/go-task/task/issues/53), [#359](https://github.com/go-task/task/issues/359)).
## v3.6.0 - 2021-07-10
- Allow using both `sources:` and `status:` in the same task ([#411](https://github.com/go-task/task/issues/411), [#427](https://github.com/go-task/task/issues/427), [#477](https://github.com/go-task/task/issues/477)).
- Small optimization and bug fix: don't compute variables if not needed for `dotenv:` ([#517](https://github.com/go-task/task/issues/517)).
## v3.5.0 - 2021-07-04
- Add support for interpolation in `dotenv:` ([#433](https://github.com/go-task/task/issues/433), [#434](https://github.com/go-task/task/issues/434), [#453](https://github.com/go-task/task/issues/453)).
## v3.4.3 - 2021-05-30
- Add support for the `NO_COLOR` environment variable. ([#459](https://github.com/go-task/task/issues/459), [fatih/color\[#137\](https://github.com/go-task/task/issues/137)](https://github.com/fatih/color/pull/137)).
- Fix bug where sources were not considering the right directory in `--watch` mode ([#484](https://github.com/go-task/task/issues/484), [#485](https://github.com/go-task/task/issues/485)).
## v3.4.2 - 2021-04-23
- On watch, report which file failed to read ([#472](https://github.com/go-task/task/issues/472)).
- Do not try to catch SIGKILL signal, which are not actually possible ([#476](https://github.com/go-task/task/issues/476)).
- Improve version reporting when building Task from source using Go Modules ([#462](https://github.com/go-task/task/issues/462), [#473](https://github.com/go-task/task/issues/473)).
## v3.4.1 - 2021-04-17
- Improve error reporting when parsing YAML: in some situations where you would just see an generic error, you'll now see the actual error with more detail: the YAML line the failed to parse, for example ([#467](https://github.com/go-task/task/issues/467)).
- A JSON Schema was published [here](https://json.schemastore.org/taskfile.json) and is automatically being used by some editors like Visual Studio Code ([#135](https://github.com/go-task/task/issues/135)).
- Print task name before the command in the log output ([#398](https://github.com/go-task/task/issues/398)).
## v3.3.0 - 2021-03-20
- Add support for delegating CLI arguments to commands with `--` and a special `CLI_ARGS` variable ([#327](https://github.com/go-task/task/issues/327)).
- Add a `--concurrency` (alias `-C`) flag, to limit the number of tasks that run concurrently. This is useful for heavy workloads. ([#345](https://github.com/go-task/task/issues/345)).
## v3.2.2 - 2021-01-12
- Improve performance of `--list` and `--summary` by skipping running shell variables for these flags ([#332](https://github.com/go-task/task/issues/332)).
- Fixed a bug where an environment in a Taskfile was not always overridable by the system environment ([#425](https://github.com/go-task/task/issues/425)).
- Fixed environment from .env files not being available as variables ([#379](https://github.com/go-task/task/issues/379)).
- The install script is now working for ARM platforms ([#428](https://github.com/go-task/task/issues/428)).
## v3.2.1 - 2021-01-09
- Fixed some bugs and regressions regarding dynamic variables and directories ([#426](https://github.com/go-task/task/issues/426)).
- The [slim-sprig](https://github.com/go-task/slim-sprig) package was updated with the upstream [sprig](https://github.com/Masterminds/sprig).
## v3.2.0 - 2021-01-07
- Fix the `.task` directory being created in the task directory instead of the Taskfile directory ([#247](https://github.com/go-task/task/issues/247)).
- Fix a bug where dynamic variables (those declared with `sh:`) were not running in the task directory when the task has a custom dir or it was in an included Taskfile ([#384](https://github.com/go-task/task/issues/384)).
- The watch feature (via the `--watch` flag) got a few different bug fixes and should be more stable now ([#423](https://github.com/go-task/task/issues/423), [#365](https://github.com/go-task/task/issues/365)).
## v3.1.0 - 2021-01-03
- Fix a bug when the checksum up-to-date resolution is used by a task with a custom `label:` attribute ([#412](https://github.com/go-task/task/issues/412)).
- Starting from this release, we're releasing official ARMv6 and ARM64 binaries for Linux ([#375](https://github.com/go-task/task/issues/375), [#418](https://github.com/go-task/task/issues/418)).
- Task now respects the order of declaration of included Taskfiles when evaluating variables declaring by them ([#393](https://github.com/go-task/task/issues/393)).
- `set -e` is now automatically set on every command. This was done to fix an issue where multiline string commands wouldn't really fail unless the sentence was in the last line ([#403](https://github.com/go-task/task/issues/403)).
## v3.0.1 - 2020-12-26
- Allow use as a library by moving the required packages out of the `internal` directory ([#358](https://github.com/go-task/task/issues/358)).
- Do not error if a specified dotenv file does not exist ([#378](https://github.com/go-task/task/issues/378), [#385](https://github.com/go-task/task/issues/385)).
- Fix panic when you have empty tasks in your Taskfile ([#338](https://github.com/go-task/task/issues/338), [#362](https://github.com/go-task/task/issues/362)).
## v3.0.0 - 2020-08-16
- On `v3`, all CLI variables will be considered global variables ([#336](https://github.com/go-task/task/issues/336), [#341](https://github.com/go-task/task/issues/341))
- Add support to `.env` like files ([#324](https://github.com/go-task/task/issues/324), [#356](https://github.com/go-task/task/issues/356)).
- Add `label:` to task so you can override the task name in the logs ([\[#321\](https://github.com/go-task/task/issues/321)](https://github.com/go-task/task/issues/321]), [#337](https://github.com/go-task/task/issues/337)).
- Refactor how variables work on version 3 ([#311](https://github.com/go-task/task/issues/311)).
- Disallow `expansions` on v3 since it has no effect.
- `Taskvars.yml` is not automatically included anymore.
- `Taskfile_{{OS}}.yml` is not automatically included anymore.
- Allow interpolation on `includes`, so you can manually include a Taskfile based on operation system, for example.
- Expose `.TASK` variable in templates with the task name ([#252](https://github.com/go-task/task/issues/252)).
- Implement short task syntax ([#194](https://github.com/go-task/task/issues/194), [#240](https://github.com/go-task/task/issues/240)).
- Added option to make included Taskfile run commands on its own directory ([#260](https://github.com/go-task/task/issues/260), [#144](https://github.com/go-task/task/issues/144))
- Taskfiles in version 1 are not supported anymore ([#237](https://github.com/go-task/task/issues/237)).
- Added global `method:` option. With this option, you can set a default method to all tasks in a Taskfile ([#246](https://github.com/go-task/task/issues/246)).
- Changed default method from `timestamp` to `checksum` ([#246](https://github.com/go-task/task/issues/246)).
- New magic variables are now available when using `status:`: `.TIMESTAMP` which contains the greatest modification date from the files listed in `sources:`, and `.CHECKSUM`, which contains a checksum of all files listed in `status:`. This is useful for manual checking when using external, or even remote, artifacts when using `status:` ([#216](https://github.com/go-task/task/issues/216)).
- We're now using [slim-sprig](https://github.com/go-task/slim-sprig) instead of [sprig](https://github.com/Masterminds/sprig), which allowed a file size reduction of about 22% ([#219](https://github.com/go-task/task/issues/219)).
- We now use some colors on Task output to better distinguish message types - commands are green, errors are red, etc ([#207](https://github.com/go-task/task/issues/207)).
## v2.8.1 - 2020-05-20
- Fix error code for the `--help` flag ([#300](https://github.com/go-task/task/issues/300), [#330](https://github.com/go-task/task/issues/330)).
- Print version to stdout instead of stderr ([#299](https://github.com/go-task/task/issues/299), [#329](https://github.com/go-task/task/issues/329)).
- Supress `context` errors when using the `--watch` flag ([#313](https://github.com/go-task/task/issues/313), [#317](https://github.com/go-task/task/issues/317)).
- Support templating on description ([#276](https://github.com/go-task/task/issues/276), [#283](https://github.com/go-task/task/issues/283)).
## v2.8.0 - 2019-12-07
- Add `--parallel` flag (alias `-p`) to run tasks given by the command line in parallel ([#266](https://github.com/go-task/task/issues/266)).
- Fixed bug where calling the `task` CLI only informing global vars would not execute the `default` task.
- Add hability to silent all tasks by adding `silent: true` a the root of the Taskfile.
## v2.7.1 - 2019-11-10
- Fix error being raised when `exit 0` was called ([#251](https://github.com/go-task/task/issues/251)).
## v2.7.0 - 2019-09-22
- Fixed panic bug when assigning a global variable ([#229](https://github.com/go-task/task/issues/229), [#243](https://github.com/go-task/task/issues/243)).
- A task with `method: checksum` will now re-run if generated files are deleted ([#228](https://github.com/go-task/task/issues/228), [#238](https://github.com/go-task/task/issues/238)).
## v2.6.0 - 2019-07-21
- Fixed some bugs regarding minor version checks on `version:`.
- Add `preconditions:` to task ([#205](https://github.com/go-task/task/issues/205)).
- Create directory informed on `dir:` if it doesn't exist ([#209](https://github.com/go-task/task/issues/209), [#211](https://github.com/go-task/task/issues/211)).
- We now have a `--taskfile` flag (alias `-t`), which can be used to run another Taskfile (other than the default `Taskfile.yml`) ([#221](https://github.com/go-task/task/issues/221)).
- It's now possible to install Task using Homebrew on Linux ([go-task/homebrew-tap\[#1\](https://github.com/go-task/task/issues/1)](https://github.com/go-task/homebrew-tap/pull/1)).
## v2.5.2 - 2019-05-11
- Reverted YAML upgrade due issues with CRLF on Windows ([#201](https://github.com/go-task/task/issues/201), [go-yaml/yaml\[#450\](https://github.com/go-task/task/issues/450)](https://github.com/go-yaml/yaml/issues/450)).
- Allow setting global variables through the CLI ([#192](https://github.com/go-task/task/issues/192)).
## 2.5.1 - 2019-04-27
- Fixed some issues with interactive command line tools, where sometimes the output were not being shown, and similar issues ([#114](https://github.com/go-task/task/issues/114), [#190](https://github.com/go-task/task/issues/190), [#200](https://github.com/go-task/task/issues/200)).
- Upgraded [go-yaml/yaml](https://github.com/go-yaml/yaml) from v2 to v3.
## v2.5.0 - 2019-03-16
- We moved from the taskfile.org domain to the new fancy taskfile.dev domain. While stuff is being redirected, we strongly recommend to everyone that use [this install script](https://taskfile.dev/#/installation?id=install-script) to use the new taskfile.dev domain on scripts from now on.
- Fixed to the ZSH completion ([#182](https://github.com/go-task/task/issues/182)).
- Add [`--summary` flag along with `summary:` task attribute](https://taskfile.org/#/usage?id=display-summary-of-task) ([#180](https://github.com/go-task/task/issues/180)).
## v2.4.0 - 2019-02-21
- Allow calling a task of the root Taskfile from an included Taskfile by prefixing it with `:` ([#161](https://github.com/go-task/task/issues/161), [#172](https://github.com/go-task/task/issues/172)).
- Add flag to override the `output` option ([#173](https://github.com/go-task/task/issues/173)).
- Fix bug where Task was persisting the new checksum on the disk when the Dry Mode is enabled ([#166](https://github.com/go-task/task/issues/166)).
- Fix file timestamp issue when the file name has spaces ([#176](https://github.com/go-task/task/issues/176)).
- Mitigating path expanding issues on Windows ([#170](https://github.com/go-task/task/issues/170)).
## v2.3.0 - 2019-01-02
- On Windows, Task can now be installed using [Scoop](https://scoop.sh/) ([#152](https://github.com/go-task/task/issues/152)).
- Fixed issue with file/directory globing ([#153](https://github.com/go-task/task/issues/153)).
- Added ability to globally set environment variables ([#138](https://github.com/go-task/task/issues/138), [#159](https://github.com/go-task/task/issues/159)).
## v2.2.1 - 2018-12-09
- This repository now uses Go Modules ([#143](https://github.com/go-task/task/issues/143)). We'll still keep the `vendor` directory in sync for some time, though;
- Fixing a bug when the Taskfile has no tasks but includes another Taskfile ([#150](https://github.com/go-task/task/issues/150));
- Fix a bug when calling another task or a dependency in an included Taskfile ([#151](https://github.com/go-task/task/issues/151)).
## v2.2.0 - 2018-10-25
- Added support for [including other Taskfiles](https://taskfile.org/#/usage?id=including-other-taskfiles) ([#98](https://github.com/go-task/task/issues/98))
- This should be considered experimental. For now, only including local files is supported, but support for including remote Taskfiles is being discussed. If you have any feedback, please comment on [#98](https://github.com/go-task/task/issues/98).
- Task now have a dedicated documentation site: https://taskfile.org
- Thanks to [Docsify](https://docsify.js.org/) for making this pretty easy. To check the source code, just take a look at the [docs](https://github.com/go-task/task/tree/master/docs) directory of this repository. Contributions to the documentation is really appreciated.
## v2.1.1 - 2018-09-17
- Fix suggestion to use `task --init` not being shown anymore (when a `Taskfile.yml` is not found)
- Fix error when using checksum method and no file exists for a source glob ([#131](https://github.com/go-task/task/issues/131))
- Fix signal handling when the `--watch` flag is given ([#132](https://github.com/go-task/task/issues/132))
## v2.1.0 - 2018-08-19
- Add a `ignore_error` option to task and command ([#123](https://github.com/go-task/task/issues/123))
- Add a dry run mode (`--dry` flag) ([#126](https://github.com/go-task/task/issues/126))
## v2.0.3 - 2018-06-24
- Expand environment variables on "dir", "sources" and "generates" ([#116](https://github.com/go-task/task/issues/116))
- Fix YAML merging syntax ([#112](https://github.com/go-task/task/issues/112))
- Add ZSH completion ([#111](https://github.com/go-task/task/issues/111))
- Implement new `output` option. Please check out the [documentation](https://github.com/go-task/task#output-syntax)
## v2.0.2 - 2018-05-01
- Fix merging of YAML anchors ([#112](https://github.com/go-task/task/issues/112))
## v2.0.1 - 2018-03-11
- Fixes panic on `task --list`
## v2.0.0 - 2018-03-08
Version 2.0.0 is here, with a new Taskfile format.
Please, make sure to read the [Taskfile versions](https://github.com/go-task/task/blob/master/TASKFILE_VERSIONS.md) document, since it describes in depth what changed for this version.
- New Taskfile version 2 ([#77](https://github.com/go-task/task/issues/77))
- Possibility to have global variables in the `Taskfile.yml` instead of `Taskvars.yml` ([#66](https://github.com/go-task/task/issues/66))
- Small improvements and fixes
## v1.4.4 - 2017-11-19
- Handle SIGINT and SIGTERM ([#75](https://github.com/go-task/task/issues/75));
- List: print message with there's no task with description;
- Expand home dir ("~" symbol) on paths ([#74](https://github.com/go-task/task/issues/74));
- Add Snap as an installation method;
- Move examples to its own repo;
- Watch: also walk on tasks called on on "cmds", and not only on "deps";
- Print logs to stderr instead of stdout ([#68](https://github.com/go-task/task/issues/68));
- Remove deprecated `set` keyword;
- Add checksum based status check, alternative to timestamp based.
## v1.4.3 - 2017-09-07
- Allow assigning variables to tasks at run time via CLI ([#33](https://github.com/go-task/task/issues/33))
- Added suport for multiline variables from sh ([#64](https://github.com/go-task/task/issues/64))
- Fixes env: remove square braces and evaluate shell ([#62](https://github.com/go-task/task/issues/62))
- Watch: change watch library and few fixes and improvements
- When use watching, cancel and restart long running process on file change ([#59](https://github.com/go-task/task/issues/59) and [#60](https://github.com/go-task/task/issues/60))
## v1.4.2 - 2017-07-30
- Flag to set directory of execution
- Always echo command if is verbose mode
- Add silent mode to disable echoing of commands
- Fixes and improvements of variables ([#56](https://github.com/go-task/task/issues/56))
## v1.4.1 - 2017-07-15
- Allow use of YAML for dynamic variables instead of $ prefix
- `VAR: {sh: echo Hello}` instead of `VAR: $echo Hello`
- Add `--list` (or `-l`) flag to print existing tasks
- OS specific Taskvars file (e.g. `Taskvars_windows.yml`, `Taskvars_linux.yml`, etc)
- Consider task up-to-date on equal timestamps ([#49](https://github.com/go-task/task/issues/49))
- Allow absolute path in generates section ([#48](https://github.com/go-task/task/issues/48))
- Bugfix: allow templating when calling deps ([#42](https://github.com/go-task/task/issues/42))
- Fix panic for invalid task in cyclic dep detection
- Better error output for dynamic variables in Taskvars.yml ([#41](https://github.com/go-task/task/issues/41))
- Allow template evaluation in parameters
## v1.4.0 - 2017-07-06
- Cache dynamic variables
- Add verbose mode (`-v` flag)
- Support to task parameters (overriding vars) ([#31](https://github.com/go-task/task/issues/31)) ([#32](https://github.com/go-task/task/issues/32))
- Print command, also when "set:" is specified ([#35](https://github.com/go-task/task/issues/35))
- Improve task command help text ([#35](https://github.com/go-task/task/issues/35))
## v1.3.1 - 2017-06-14
- Fix glob not working on commands ([#28](https://github.com/go-task/task/issues/28))
- Add ExeExt template function
- Add `--init` flag to create a new Taskfile
- Add status option to prevent task from running ([#27](https://github.com/go-task/task/issues/27))
- Allow interpolation on `generates` and `sources` attributes ([#26](https://github.com/go-task/task/issues/26))
## v1.3.0 - 2017-04-24
- Migrate from os/exec.Cmd to a native Go sh/bash interpreter
- This is a potentially breaking change if you use Windows.
- Now, `cmd` is not used anymore on Windows. Always use Bash-like syntax for your commands, even on Windows.
- Add "ToSlash" and "FromSlash" to template functions
- Use functions defined on github.com/Masterminds/sprig
- Do not redirect stdin while running variables commands
- Using `context` and `errgroup` packages (this will make other tasks to be cancelled, if one returned an error)
## v1.2.0 - 2017-04-02
- More tests and Travis integration
- Watch a task (experimental)
- Possibility to call another task
- Fix "=" not being reconized in variables/environment variables
- Tasks can now have a description, and help will print them ([#10](https://github.com/go-task/task/issues/10))
- Task dependencies now run concurrently
- Support for a default task ([#16](https://github.com/go-task/task/issues/16))
## v1.1.0 - 2017-03-08
- Support for YAML, TOML and JSON ([#1](https://github.com/go-task/task/issues/1))
- Support running command in another directory ([#4](https://github.com/go-task/task/issues/4))
- `--force` or `-f` flag to force execution of task even when it's up-to-date
- Detection of cyclic dependencies ([#5](https://github.com/go-task/task/issues/5))
- Support for variables ([#6](https://github.com/go-task/task/issues/6), [#9](https://github.com/go-task/task/issues/9), [#14](https://github.com/go-task/task/issues/14))
- Operation System specific commands and variables ([#13](https://github.com/go-task/task/issues/13))
## v1.0.0 - 2017-02-28
- Add LICENSE file

View File

@ -0,0 +1,50 @@
---
slug: /community/
sidebar_position: 8
---
# Community
Some of the work to improve the Task ecosystem is done by the community, be it installation methods or integrations with code editor. I (the author) am thankful for everyone that helps me to improve the overall experience.
## Translations
[@DeronW](https://github.com/DeronW) maintains the [Chinese translation](https://task-zh.readthedocs.io/zh_CN/latest/) of the website [on this repository](https://github.com/DeronW/task).
## Editor Integrations
### JSON Schema
Initial work on the schema was made by [@KROSF](https://github.com/KROSF) on [this Gist](https://gist.github.com/KROSF/c5435acf590acd632f71bb720f685895). The schema is currently available at https://taskfile.dev/schema.json and linked at https://json.schemastore.org/taskfile.json so it is be used automatically many code editors, like VSCode. Contributions can be done by editing [this file](https://github.com/go-task/task/blob/master/docs/static/schema.json).
### Visual Studio Code extension
Additionally, there's also some work done by [@paulvarache](https://github.com/paulvarache) in making an Visual Studio Code extension, which has its code [here](https://github.com/paulvarache/vscode-taskfile) and is published [here](https://marketplace.visualstudio.com/items?itemName=paulvarache.vscode-taskfile).
### Sublime Text 4 package
There is a convenience wrapper for initializing and running tasks from Sublime Text's command palette. The package is developed by [@biozz](https://github.com/biozz), the source code is available [here](https://github.com/biozz/sublime-taskfile) and it is published on Package Control [here](https://packagecontrol.io/packages/Taskfile).
### IntelliJ plugin
There's a JetBrains IntelliJ plugin done by [@lechuckroh](https://github.com/lechuckroh), which has its code [here](https://github.com/lechuckroh/task-intellij-plugin) and is published [here](https://plugins.jetbrains.com/plugin/17058-taskfile).
## Other Integrations
- [mk](https://github.com/pycontribs/mk) command line tool recognizes Taskfiles natively.
## Installation methods
Some installation methods are maintained by third party:
- [GitHub Actions](https://github.com/arduino/setup-task) by [@arduino](https://github.com/arduino)
- [AUR](https://aur.archlinux.org/packages/go-task-bin) by [@carlsmedstad](https://github.com/carlsmedstad)
- [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)
- [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
- [NixOS](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/go-task/default.nix)
## More
Also, thanks for all the [code contributors](https://github.com/go-task/task/graphs/contributors), [financial contributors](https://opencollective.com/task), all those who [reported bugs](https://github.com/go-task/task/issues?q=is%3Aissue) and [answered questions](https://github.com/go-task/task/discussions).
If you know something that is missing in this document, please submit a pull request.

View File

@ -0,0 +1,69 @@
---
slug: /contributing/
sidebar_position: 9
---
# Contributing
Contributions to Task are very welcome, but we ask that you read this document before submitting a PR.
## Before you start
- **Check existing work** - Is there an existing PR? Are there issues discussing the feature/change you want to make? Please make sure you consider/address these discussions in your work.
- **Backwards compatibility** - Will your change break existing Taskfiles? It is much more likely that your change will merged if it backwards compatible. Is there an approach you can take that maintains this compatibility? If not, consider opening an issue first so that API changes can be discussed before you invest your time into a PR.
## 1. Setup
- **Go** - Task is written in [Go](https://go.dev). We always support the latest two major Go versions, so make sure your version is recent enough.
- **Node.js** - [Node.js](https://nodejs.org/en/) is used to host Task's documentation server and is required if you want to run this server locally.
- **Yarn** - [Yarn](https://yarnpkg.com/) is the Node.js package manager used by Task.
## 2. Making changes
- **Code style** - Try to maintain the existing code style where possible and ensure that code is formatted by `gofmt`. We use `golangci-lint` in our CI to enforce a consistent style and best-practice. There's a `lint` command in the Taskfile to run this locally.
- **Documentation** - Ensure that you add/update any relevant documentation. See the [updating documentation](#updating-documentation) section below.
- **Tests** - Ensure that you add/update any relevant tests and that all tests are passing before submitting the PR. See the [writing tests](#writing-tests) section below.
### Running your changes
To run Task with working changes, you can use `go run ./cmd/task`. To run a development build of task against a test Taskfile in `testdata`, you can use `go
run ./cmd/task --dir ./testdata/<my_test_dir> <task_name>`.
### Updating documentation
Task uses [Docusaurus](https://docusaurus.io) to host a documentation server. This can be setup and run locally by using `task docs` (requires `nodejs` & `yarn`). All content is written in Markdown and is located in the `docs/docs` directory. All Markdown documents should have an 80 character line wrap limit.
When making a change, consider whether a change to the [Usage Guide](./usage.md) is necessary. This document contains descriptions and examples of how to use Task features. If you're adding a new feature, try to find an appropriate place to add a new section. If you're updating an existing feature, ensure that the documentation and any examples are up-to-date. Ensure that any examples follow the [Taskfile Styleguide](./styleguide.md).
If you added a new field, command or flag, ensure that you add it to the [API Reference](./api_reference.md). New fields also need to be added to the [JSON Schema](https://github.com/go-task/task/blob/master/docs/static/schema.json). The descriptions for fields in the API reference and the schema should match.
### Writing tests
Most of Task's test are held in the `task_test.go` file in the project root and this is where you'll most likely want to add new ones too. Most of these tests also have a subdirectory in the `testdata` directory where any Taskfiles/data required to run the tests are stored.
When making a changes, consider whether new tests are required. These tests should ensure that the functionality you are adding will continue to work in the future. Existing tests may also need updating if you have changed Task's behaviour.
## 3. Committing your code
Try to write meaningful commit messages and avoid having too many commits on the PR. Most PRs should likely have a single commit (although for bigger PRs it may be reasonable to split it in a few). Git squash and rebase is your friend!
## 4. Submitting a PR
- **Describe your changes** - Ensure that you provide a comprehensive description of your changes.
- **Issue/PR links** - Link any previous work such as related issues or PRs. Please describe how your changes differ to/extend this work.
- **Examples** - Add any examples that you think are useful to demonstrate the effect of your changes.
- **Draft PRs** - If your changes are incomplete, but you would like to discuss them, open the PR as a draft and add a comment to start a discussion. Using comments rather than the PR description allows the description to be updated later while preserving any discussions.
## FAQ
> I want to contribute, where do I start?
Take a look at the list of [open issues](https://github.com/go-task/task/issues). We have a [good first issue](https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label for simpler issues that are ideal for first time contributions.
All kinds of contributions are welcome, whether its a typo fix or a shiny new feature. You can also contribute by upvoting/commenting on issues, helping to answer questions or contributing to other [community projects](./community.md).
> I'm stuck, where can I get help?
If you have questions, feel free to ask them in the `#help` forum channel on our [Discord server](https://discord.gg/6TY36E39UK) or open a [Discussion](https://github.com/go-task/task/discussions) on GitHub.
---

View File

@ -0,0 +1,39 @@
---
slug: /donate/
sidebar_position: 12
---
# Donate
If you find this project useful, you can consider donating by using one of the channels listed below.
This is just a way of saying "thank you", it won't give you any benefits like higher priority on issues or something similar.
Companies who donate at least $50/month will be featured as a "Gold Sponsor" in the website homepage and on the GitHub repository README. Make contact with [@andreynering](https://github.com/andreynering) with the logo you want to be shown. Suspect businesses (gambling, casinos, etc) won't be allowed, though.
## GitHub Sponsors
The preferred way to donate to the maintainers is via GitHub Sponsors. Just use the following links to do your donation:
- [@andreynering](https://github.com/sponsors/andreynering)
- [@pd93](https://github.com/sponsors/pd93)
## Open Collective
If you prefer [Open Collective](https://opencollective.com/task) you can donate by using these links:
- [$2 per month](https://opencollective.com/task/contribute/backer-4034/checkout)
- [$5 per month](https://opencollective.com/task/contribute/supporter-8404/checkout)
- [$20 per month](https://opencollective.com/task/contribute/sponsor-4035/checkout)
- [$50 per month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
- [Custom value - One-time donation option supported](https://opencollective.com/task/donate)
## PayPal
You can donate to [@andreynering](https://github.com/andreynering) via PayPal as well:
- [Any value - One-time donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url)
## PIX (Brazil only)
And if you're Brazilian, you can also donate to [@andreynering](https://github.com/andreynering) via PIX by [using this QR Code](/img/pix.png).

View File

@ -0,0 +1,40 @@
---
slug: /faq/
sidebar_position: 5
---
# FAQ
This page contains a list of frequently asked questions about Task.
- [Why won't my task update my shell environment?](#why-wont-my-task-update-my-shell-environment)
- ['x' builtin command doesn't work on Windows](#x-builtin-command-doesnt-work-on-windows)
## Why won't my task update my shell environment?
This is a limitation of how shells work. Task runs as a subprocess of your current shell, so it can't change the environment of the shell that started it. This limitation is shared by other task runners and build tools too.
A common way to work around this is to create a task that will generate output that can be parsed by your shell. For example, to set an environment variable on your shell you can write a task like this:
```yaml
my-shell-env:
cmds:
- echo "export FOO=foo"
- echo "export BAR=bar"
```
Now run `eval $(task my-shell-env)` and the variables `$FOO` and `$BAR` will be available in your shell.
## 'x' builtin command doesn't work on Windows
The default shell on Windows (`cmd` and `powershell`) do not have commands like `rm` and `cp` available as builtins. This means that these commands won't work. If you want to make your Taskfile fully cross-platform, you'll need to work around this limitation using one of the following methods:
- Use the `{{OS}}` function to run an OS-specific script.
- Use something like `{{if eq OS "windows"}}powershell {{end}}<my_cmd>` to detect windows and run the command in Powershell directly.
- Use a shell on Windows that supports these commands as builtins, such as [Git Bash](https://gitforwindows.org/) or [WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
We want to make improvements to this part of Task and the issues below track this work. Constructive comments and contributions are very welcome!
- [#197](https://github.com/go-task/task/issues/197)
- [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
- [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)

View File

@ -0,0 +1,231 @@
---
slug: /installation/
sidebar_position: 2
---
# Installation
Task offers many installation methods. Check out the available methods below.
## Package Managers
### Homebrew
If you're on macOS or Linux and have [Homebrew](https://brew.sh/) installed, getting Task is as simple as running:
```bash
brew install go-task/tap/go-task
```
The above Formula is [maintained by ourselves](https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb).
Recently, Task was also made available [on the official Homebrew repository](https://formulae.brew.sh/formula/go-task), so you also have that option if you prefer:
```bash
brew install go-task
```
### Snap
Task is available in [Snapcraft](https://snapcraft.io/task), but keep in mind that your Linux distribution should allow classic confinement for Snaps to Task work right:
```bash
sudo snap install task --classic
```
### Chocolatey
If you're on Windows and have [Chocolatey](https://chocolatey.org/) installed, getting Task is as simple as running:
```bash
choco install go-task
```
This installation method is community owned.
### Scoop
If you're on Windows and have [Scoop](https://scoop.sh/) installed, getting Task is as simple as running:
```cmd
scoop install task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available on Scoop.
### AUR
If you're on Arch Linux you can install Task from [AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite package manager such as `yay`, `pacaur` or `yaourt`:
```cmd
yay -S go-task-bin
```
Alternatively, there's [this package](https://aur.archlinux.org/packages/go-task) which installs from the source code instead of downloading the binary from the [releases page](https://github.com/go-task/task/releases):
```cmd
yay -S go-task
```
This installation method is community owned.
### Fedora
If you're on Fedora Linux you can install Task from the official [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/) repository using `dnf`:
```cmd
sudo dnf install go-task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/).
### Nix
If you're on NixOS or have Nix installed you can install Task from [nixpkgs](https://github.com/NixOS/nixpkgs):
```cmd
nix-env -iA nixpkgs.go-task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [nixpkgs](https://github.com/NixOS/nixpkgs).
### npm
You can also use Node and npm to install Task by installing [this package](https://www.npmjs.com/package/@go-task/cli).
```bash
npm install -g @go-task/cli
```
## Get The Binary
### Binary
You can download the binary from the [releases page on GitHub](https://github.com/go-task/task/releases) and add to your `$PATH`.
DEB and RPM packages are also available.
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
### Install Script
We also have an [install script](https://github.com/go-task/task/blob/master/install-task.sh) which is very useful in scenarios like CI. Many thanks to [GoDownloader](https://github.com/goreleaser/godownloader) for enabling the easy generation of this script.
By default, it installs on the `./bin` directory relative to the working directory:
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
```
It is possible to override the installation directory with the `-b` parameter. On Linux, common choices are `~/.local/bin` and `~/bin` to install for the current user or `/usr/local/bin` to install for all users:
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
```
:::caution
On macOS and Windows, `~/.local/bin` and `~/bin` are not added to `$PATH` by default.
:::
### GitHub Actions
If you want to install Task in GitHub Actions you can try using [this action](https://github.com/arduino/setup-task) by the Arduino team:
```yaml
- name: Install Task
uses: arduino/setup-task@v1
```
This installation method is community owned.
## Build From Source
### Go Modules
Ensure that you have a supported version of [Go](https://golang.org/) properly installed and setup. You can find the minimum required version of Go in the [go.mod](https://github.com/go-task/task/blob/master/go.mod#L3) file.
You can then install the latest release globally by running:
```bash
go install github.com/go-task/task/v3/cmd/task@latest
```
Or you can install into another directory:
```bash
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
```
:::tip
For CI environments we recommend using the [install script](#get-the-binary) instead, which is faster and more stable, since it'll just download the latest released binary.
:::
## Setup completions
Download the autocompletion file corresponding to your shell.
[All completions are available on the Task repository](https://github.com/go-task/task/tree/master/completion).
### Bash
First, ensure that you installed bash-completion using your package manager.
Make the completion file executable:
```
chmod +x path/to/task.bash
```
After, add this to your `~/.bash_profile`:
```shell
source path/to/task.bash
```
### ZSH
Put the `_task` file somewhere in your `$FPATH`:
```shell
mv path/to/_task /usr/local/share/zsh/site-functions/_task
```
Ensure that the following is present in your `~/.zshrc`:
```shell
autoload -U compinit
compinit -i
```
ZSH version 5.7 or later is recommended.
### Fish
Move the `task.fish` completion script:
```shell
mv path/to/task.fish ~/.config/fish/completions/task.fish
```
### PowerShell
Open your profile script with:
```
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
notepad $profile
```
Add the line and save the file:
```shell
Invoke-Expression -Command path/to/task.ps1
```

View File

@ -0,0 +1,48 @@
---
slug: /
sidebar_position: 1
title: Home
---
# Task
<div align="center">
<img id="logo" src="img/logo.svg" height="250px" width="250px" />
</div>
Task is a task runner / build tool that aims to be simpler and easier to use than, for example, [GNU Make](https://www.gnu.org/software/make/).
Since it's written in [Go](https://go.dev/), Task is just a single binary and has no other dependencies, which means you don't need to mess with any complicated install setups just to use a build tool.
Once [installed](installation.md), you just need to describe your build tasks using a simple [YAML](http://yaml.org/) schema in a file called `Taskfile.yml`:
```yaml title="Taskfile.yml"
version: '3'
tasks:
hello:
cmds:
- echo 'Hello World from Task!'
silent: true
```
And call it by running `task hello` from your terminal.
The above example is just the start, you can take a look at the [usage](/usage) guide to check the full schema documentation and Task features.
## Features
- [Easy installation](installation.md): just download a single binary, add to `$PATH` and you're done! Or you can also install using [Homebrew](https://brew.sh/), [Snapcraft](https://snapcraft.io/), or [Scoop](https://scoop.sh/) if you want.
- Available on CIs: by adding [this simple command](installation.md#install-script) to install on your CI script and you're ready to use Task as part of your CI pipeline;
- Truly cross-platform: while most build tools only work well on Linux or macOS, Task also supports Windows thanks to [this shell interpreter for Go](https://github.com/mvdan/sh).
- Great for code generation: you can easily [prevent a task from running](/usage#prevent-unnecessary-work) if a given set of files haven't changed since last run (based either on its timestamp or content).
## Gold Sponsors
<div class="gold-sponsors">
| [Appwrite](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
| ---------------------------------------------------------------------------------------------------------------------------- |
| [![Appwrite](/img/appwrite.svg)](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
</div>

View File

@ -0,0 +1,35 @@
---
slug: /releasing/
sidebar_position: 10
---
# Releasing
The release process of Task is done with the help of [GoReleaser](https://goreleaser.com/). You can test the release process locally by calling the `test-release` task of the Taskfile.
[GitHub Actions](https://github.com/go-task/task/actions) should release artifacts automatically when a new Git tag is pushed to master (raw executables and DEB and RPM packages).
Since v3.15.0, raw executables can also be reproduced and verified locally by checking out a specific tag and calling `goreleaser build`, using the Go version defined in the above GitHub Actions.
# Homebrew
Goreleaser will automatically push a new commit to the [Formula/go-task.rb](https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb) file in the [Homebrew tap](https://github.com/go-task/homebrew-tap) repository to release the new version.
# npm
To release to npm update the version in the [`package.json`](https://github.com/go-task/task/blob/master/package.json#L3) file and then run `task npm:publish` to push it.
# Snapcraft
The [snap package](https://github.com/go-task/snap) requires to manual steps to release a new version:
* Updating the current version on [snapcraft.yaml](https://github.com/go-task/snap/blob/master/snap/snapcraft.yaml#L2).
* Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel on the [Snapcraft dashboard](https://snapcraft.io/task/releases).
# Scoop
Scoop is a command-line package manager for the Windows operating system. Scoop package manifests are maintained by the community. Scoop owners usually take care of updating versions there by editing [this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json). If you think its Task version is outdated, open an issue to let us know.
# Nix
Nix is a community owned installation method. Nix package maintainers usually take care of updating versions there by editing [this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/tools/go-task/default.nix). If you think its Task version is outdated, open an issue to let us know.

View File

@ -0,0 +1,209 @@
---
slug: /styleguide/
sidebar_position: 6
---
# Styleguide
This is the official Task styleguide for `Taskfile.yml` files. This guide contains some basic instructions to keep your Taskfile clean and familiar to other users.
This contains general guidelines, but they don't necessarily need to be strictly followed. Feel free to disagree and proceed differently at some point if you need or want to. Also, feel free to open issues or pull requests with improvements to this guide.
## Use `Taskfile.yml` and not `taskfile.yml`
```yaml
# bad
taskfile.yml
# good
Taskfile.yml
```
This is important especially for Linux users. Windows and macOS have case insensitive filesystems, so `taskfile.yml` will end up working, even that not officially supported. On Linux, only `Taskfile.yml` will work, though.
## Use the correct order of keywords
- `version:`
- `includes:`
- Configuration ones, like `output:`, `silent:`, `method:` and `run:`
- `vars:`
- `env:`, `dotenv:`
- `tasks:`
## Use 2 spaces for indentation
This is the most common convention for YAML files, and Task follows it.
```yaml
# bad
tasks:
foo:
cmds:
- echo 'foo'
# good
tasks:
foo:
cmds:
- echo 'foo'
```
## Separate with spaces the mains sections
```yaml
# bad
version: '3'
includes:
docker: ./docker/Taskfile.yml
output: prefixed
vars:
FOO: bar
env:
BAR: baz
tasks:
# ...
# good
version: '3'
includes:
docker: ./docker/Taskfile.yml
output: prefixed
vars:
FOO: bar
env:
BAR: baz
tasks:
# ...
```
## Add spaces between tasks
```yaml
# bad
version: '3'
tasks:
foo:
cmds:
- echo 'foo'
bar:
cmds:
- echo 'bar'
baz:
cmds:
- echo 'baz'
# good
version: '3'
tasks:
foo:
cmds:
- echo 'foo'
bar:
cmds:
- echo 'bar'
baz:
cmds:
- echo 'baz'
```
## Use upper-case variable names
```yaml
# bad
version: '3'
vars:
binary_name: myapp
tasks:
build:
cmds:
- go build -o {{.binary_name}} .
# good
version: '3'
vars:
BINARY_NAME: myapp
tasks:
build:
cmds:
- go build -o {{.BINARY_NAME}} .
```
## Don't wrap vars in spaces when templating
```yaml
# bad
version: '3'
tasks:
greet:
cmds:
- echo '{{ .MESSAGE }}'
# good
version: '3'
tasks:
greet:
cmds:
- echo '{{.MESSAGE}}'
```
This convention is also used by most people for any Go templating.
## Separate task name words with a dash
```yaml
# bad
version: '3'
tasks:
do_something_fancy:
cmds:
- echo 'Do something'
# good
version: '3'
tasks:
do-something-fancy:
cmds:
- echo 'Do something'
```
## Use colon for task namespacing
```yaml
# good
version: '3'
tasks:
docker:build:
cmds:
- docker ...
docker:run:
cmds:
- docker-compose ...
```
This is also done automatically when using included Taskfiles.

View File

@ -0,0 +1,204 @@
---
slug: /taskfile-versions/
sidebar_position: 11
---
# Taskfile Versions
The Taskfile syntax and features changed with time. This document explains what changed on each version and how to upgrade your Taskfile.
## What the Taskfile version mean
The Taskfile version follows the Task version. E.g. the change to Taskfile version `2` means that Task `v2.0.0` should be release to support it.
The `version:` key on Taskfile accepts a semver string, so either `2`, `2.0` or `2.0.0` is accepted. If you choose to use `2.0` Task will not enable future `2.1` features, but if you choose to use `2`, then any `2.x.x` features will be available, but not `3.0.0+`.
## Version 1
> NOTE: Taskfiles in version 1 are not supported on Task >= v3.0.0 anymore.
In the first version of the `Taskfile`, the `version:` key was not available, because the tasks was in the root of the YAML document. Like this:
```yaml
echo:
cmds:
- echo "Hello, World!"
```
The variable priority order was also different:
1. Call variables
2. Environment
3. Task variables
4. `Taskvars.yml` variables
## Version 2.0
At version 2, we introduced the `version:` key, to allow us to evolve Task with new features without breaking existing Taskfiles. The new syntax is as follows:
```yaml
version: '2'
tasks:
echo:
cmds:
- echo "Hello, World!"
```
Version 2 allows you to write global variables directly in the Taskfile, if you don't want to create a `Taskvars.yml`:
```yaml
version: '2'
vars:
GREETING: Hello, World!
tasks:
greet:
cmds:
- echo "{{.GREETING}}"
```
The variable priority order changed to the following:
1. Task variables
2. Call variables
3. Taskfile variables
4. Taskvars file variables
5. Environment variables
A new global option was added to configure the number of variables expansions (which default to 2):
```yaml
version: '2'
expansions: 3
vars:
FOO: foo
BAR: bar
BAZ: baz
FOOBAR: "{{.FOO}}{{.BAR}}"
FOOBARBAZ: "{{.FOOBAR}}{{.BAZ}}"
tasks:
default:
cmds:
- echo "{{.FOOBARBAZ}}"
```
## Version 2.1
Version 2.1 includes a global `output` option, to allow having more control over how commands output are printed to the console (see [documentation](usage.md#output-syntax) for more info):
```yaml
version: '2'
output: prefixed
tasks:
server:
cmds:
- go run main.go
prefix: server
```
From this version it's also possible to ignore errors of a command or task (check documentation [here](usage.md#ignore-errors)):
```yaml
version: '2'
tasks:
example-1:
cmds:
- cmd: exit 1
ignore_error: true
- echo "This will be print"
example-2:
cmds:
- exit 1
- echo "This will be print"
ignore_error: true
```
## Version 2.2
Version 2.2 comes with a global `includes` options to include other Taskfiles:
```yaml
version: '2'
includes:
docs: ./documentation # will look for ./documentation/Taskfile.yml
docker: ./DockerTasks.yml
```
## Version 2.6
Version 2.6 comes with `preconditions` stanza in tasks.
```yaml
version: '2'
tasks:
upload_environment:
preconditions:
- test -f .env
cmds:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation](usage.md#including-other-taskfiles)
## Version 3
These are some major changes done on `v3`:
- Task's output will now be colored
- Added support for `.env` like files
- Added `label:` setting to task so one can override how the task name appear in the logs
- A global `method:` was added to allow setting the default method, and Task's default changed to `checksum`
- Two magic variables were added when using `status:`: `CHECKSUM` and `TIMESTAMP` which contains, respectively, the md5 checksum and greatest modification timestamp of the files listed on `sources:`
- Also, the `TASK` variable is always available with the current task name
- CLI variables are always treated as global variables
- Added `dir:` option to `includes` to allow choosing on which directory an included Taskfile will run:
```yaml
includes:
docs:
taskfile: ./docs
dir: ./docs
```
- Implemented short task syntax. All below syntaxes are equivalent:
```yaml
version: '3'
tasks:
print:
cmds:
- echo "Hello, World!"
```
```yaml
version: '3'
tasks:
print:
- echo "Hello, World!"
```
```yaml
version: '3'
tasks:
print: echo "Hello, World!"
```
- There was a major refactor on how variables are handled. They're now easier to understand. The `expansions:` setting was removed as it became unncessary. This is the order in which Task will process variables, each level can see the variables set by the previous one and override those.
- Environment variables
- Global + CLI variables
- Call variables
- Task variables

View File

@ -0,0 +1,12 @@
---
slug: /translate/
sidebar_position: 13
---
# Translate
Want to help us translate this documentation? In this document we explain how.
Do NOT edit translated markdown files directly on the GitHub repository! We use [Crowdin](https://crowdin.com/project/taskfile) to allow contributors on work on translations. The repository is periodically updated with progress from Crowdin.
If you want to have access to the Crowdin project to be able to suggest translations, please ask for access on the [#translations channel on our Discord server](https://discord.gg/6TY36E39UK). If a given language is not being shown to Crowdin yet, just ask and we can configure it.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
{
"link.title.Pages": {
"message": "Pages",
"description": "The title of the footer links column with title=Pages in the footer"
},
"link.title.Community": {
"message": "Community",
"description": "The title of the footer links column with title=Community in the footer"
},
"link.title.Translations": {
"message": "Translations",
"description": "The title of the footer links column with title=Translations in the footer"
},
"link.item.label.Installation": {
"message": "Installation",
"description": "The label of footer link with label=Installation linking to /installation/"
},
"link.item.label.Usage": {
"message": "Usage",
"description": "The label of footer link with label=Usage linking to /usage/"
},
"link.item.label.Donate": {
"message": "Donate",
"description": "The label of footer link with label=Donate linking to /donate/"
},
"link.item.label.GitHub": {
"message": "GitHub",
"description": "The label of footer link with label=GitHub linking to https://github.com/go-task/task"
},
"link.item.label.Twitter": {
"message": "Twitter",
"description": "The label of footer link with label=Twitter linking to https://twitter.com/taskfiledev"
},
"link.item.label.Mastodon": {
"message": "Mastodon",
"description": "The label of footer link with label=Mastodon linking to https://fosstodon.org/@task"
},
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/6TY36E39UK"
},
"link.item.label.OpenCollective": {
"message": "OpenCollective",
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
},
"link.item.label.Chinese | 中国人": {
"message": "Chinese | 中国人",
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
}
}

View File

@ -0,0 +1,38 @@
{
"title": {
"message": "Task",
"description": "The title in the navbar"
},
"item.label.Installation": {
"message": "Installation",
"description": "Navbar item with label Installation"
},
"item.label.Usage": {
"message": "Usage",
"description": "Navbar item with label Usage"
},
"item.label.API": {
"message": "API",
"description": "Navbar item with label API"
},
"item.label.Donate": {
"message": "Donate",
"description": "Navbar item with label Donate"
},
"item.label.GitHub": {
"message": "GitHub",
"description": "Navbar item with label GitHub"
},
"item.label.Twitter": {
"message": "Twitter",
"description": "Navbar item with label Twitter"
},
"item.label.Mastodon": {
"message": "Mastodon",
"description": "Navbar item with label Mastodon"
},
"item.label.Discord": {
"message": "Discord",
"description": "Navbar item with label Discord"
}
}

396
docs/i18n/ru-RU/code.json Normal file
View File

@ -0,0 +1,396 @@
{
"theme.ErrorPageContent.title": {
"message": "This page crashed.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Try again",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Page Not Found",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "We could not find what you were looking for.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "danger",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "info",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "caution",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Scroll back to top",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archive",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archive",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Blog list page navigation",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Newer Entries",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Older Entries",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Blog post page navigation",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Newer Post",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Older Post",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "One post|{count} posts",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} tagged with \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "View All Tags",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Switch between dark and light mode (currently {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "dark mode",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "light mode",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Home page",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Docs pages navigation",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Previous",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Next",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged} with \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Version: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Edit this page",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Direct link to heading",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " on {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " by {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Last updated{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versions",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Tags:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Close",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Blog recent posts navigation",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copied",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copy code to clipboard",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copy",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Languages",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "On this page",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Read More",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Read more about {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readingTime.plurals": {
"message": "One min read|{readingTime} min read",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Back to main menu",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchBar.seeAll": {
"message": "See all {count} results"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "One document found|{count} documents found",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Type your search here",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "Search",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Search by Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "No results were found",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Fetching new results...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "Search",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "Clear the query",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "Cancel",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "Recent",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "No recent searches",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "Save this search",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "Remove this search from history",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "Favorite",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "Remove this search from favorites",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "Unable to fetch results",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "You might want to check your network connection.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "to select",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Enter key",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "to navigate",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "Arrow up",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "Arrow down",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "to close",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Escape key",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "Search by",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "No results for",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "Try searching for",
"description": "The text for the suggested query when no results are found for the following search"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
"message": "Believe this query should return results?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "Let us know.",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "Search docs",
"description": "The placeholder of the input of the DocSearch pop-up modal"
},
"theme.common.skipToMainContent": {
"message": "Skip to main content",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "Tags",
"description": "The title of the tag list page"
}
}

View File

@ -0,0 +1,5 @@
andreynering:
name: Andrey Nering
title: Maintainer of Task
url: https://github.com/andreynering
image_url: https://github.com/andreynering.png

View File

@ -0,0 +1,10 @@
{
"version.label": {
"message": "Next",
"description": "The label for version current"
},
"sidebar.tutorialSidebar.link.Chinese | 中国人": {
"message": "Chinese | 中国人",
"description": "The label for link Chinese | 中国人 in sidebar tutorialSidebar, linking to https://task-zh.readthedocs.io/zh_CN/latest/"
}
}

View File

@ -0,0 +1,291 @@
---
slug: /api/
sidebar_position: 4
toc_min_heading_level: 2
toc_max_heading_level: 5
---
# API Reference
## CLI
Task command line tool has the following syntax:
```bash
task [--flags] [tasks...] [-- CLI_ARGS...]
```
:::tip
If `--` is given, all remaning arguments will be assigned to a special `CLI_ARGS` variable
:::
| Short | Flag | Type | Default | Description |
| ----- | --------------------------- | -------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. |
| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. |
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. |
| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. |
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
| | `--json` | `bool` | `false` | See [JSON Output](#json-output) |
| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. |
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
| | `--summary` | `bool` | `false` | Show summary about a task. |
| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | |
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
| | `--version` | `bool` | `false` | Show Task version. |
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. |
## JSON Output
When using the `--json` flag in combination with either the `--list` or `--list-all` flags, the output will be a JSON object with the following structure:
```jsonc
{
"tasks": [
{
"name": "",
"desc": "",
"summary": "",
"up_to_date": false,
"location": {
"line": 54,
"column": 3,
"taskfile": "/path/to/Taskfile.yml"
}
},
// ...
],
"location": "/path/to/Taskfile.yml"
}
```
## Special Variables
There are some special variables that is available on the templating system:
| Var | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. |
| `TASK` | The name of the current task. |
| `ROOT_DIR` | The absolute path of the root Taskfile. |
| `TASKFILE_DIR` | The absolute path of the included Taskfile. |
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
| `TIMESTAMP` | The date object of the greatest timestamp of the files listes in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
| `TASK_VERSION` | The current version of task. |
## ENV
Some environment variables can be overriden to adjust Task behavior.
| ENV | Default | Description |
| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `TASK_TEMP_DIR` | `.task` | Location of the temp dir. Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
| `TASK_COLOR_RESET` | `0` | Color used for white. |
| `TASK_COLOR_BLUE` | `34` | Color used for blue. |
| `TASK_COLOR_GREEN` | `32` | Color used for green. |
| `TASK_COLOR_CYAN` | `36` | Color used for cyan. |
| `TASK_COLOR_YELLOW` | `33` | Color used for yellow. |
| `TASK_COLOR_MAGENTA` | `35` | Color used for magenta. |
| `TASK_COLOR_RED` | `31` | Color used for red. |
| `FORCE_COLOR` | | Force color output usage. |
## Taskfile Schema
| Attribute | Type | Default | Description |
| ---------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overriden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overidden with `true` in a task by task basis. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
### Include
| Attribute | Type | Default | Description |
| ---------- | --------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
:::info
Informing only a string like below is equivalent to setting that value to the `taskfile` attribute.
```yaml
includes:
foo: ./path
```
:::
### Variable
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------ |
| *itself* | `string` | | A static value that will be set to the variable. |
| `sh` | `string` | | A shell command. The output (`STDOUT`) will be assigned to the variable. |
:::info
Static and dynamic variables have different syntaxes, like below:
```yaml
vars:
STATIC: static
DYNAMIC:
sh: echo "dynamic"
```
:::
### Task
| Attribute | Type | Default | Description |
| --------------- | ---------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the task should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/master/src/go/build/syslist.go). Task will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
These alternative syntaxes are available. They will set the given values to `cmds` and everything else will be set to their default values:
```yaml
tasks:
foo: echo "foo"
foobar:
- echo "foo"
- echo "bar"
baz:
cmd: echo "baz"
```
:::
#### Command
| Attribute | Type | Default | Description |
| -------------- | ---------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cmd` | `string` | | The shell command to be executed. |
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
| `defer` | `string` | | Alternative to `cmd`, but schedules the command to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
| `platforms` | `[]string` | All platforms | Specifies which platforms the command should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/master/src/go/build/syslist.go). Command will be skipped otherwise. |
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
:::info
If given as a a string, the value will be assigned to `cmd`:
```yaml
tasks:
foo:
cmds:
- echo "foo"
- echo "bar"
```
:::
#### Dependency
| Attribute | Type | Default | Description |
| --------- | ---------------------------------- | ------- | -------------------------------------------------------- |
| `task` | `string` | | The task to be execute as a dependency. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
:::tip
If you don't want to set additional variables, it's enough to declare the dependency as a list of strings (they will be assigned to `task`):
```yaml
tasks:
foo:
deps: [foo, bar]
```
:::
#### Precondition
| Attribute | Type | Default | Description |
| --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `sh` | `string` | | Command to be executed. If a non-zero exit code is returned, the task errors without executing its commands. |
| `msg` | `string` | | Optional message to print if the precondition isn't met. |
:::tip
If you don't want to set a different message, you can declare a precondition like this and the value will be assigned to `sh`:
```yaml
tasks:
foo:
precondition: test -f Taskfile.yml
```
:::

View File

@ -0,0 +1,455 @@
---
slug: /changelog/
sidebar_position: 7
---
# Changelog
## v3.23.0 - 2023-03-26
Task now has an [official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task) contributed by [@pd93](https://github.com/pd93)! :tada: The extension is maintained in a [new repository](https://github.com/go-task/vscode-task) under the `go-task` organization. We're looking to gather feedback from the community so please give it a go and let us know what you think via a [discussion](https://github.com/go-task/vscode-task/discussions), [issue](https://github.com/go-task/vscode-task/issues) or on our [Discord](https://discord.gg/6TY36E39UK)!
> **NOTE:** The extension _requires_ v3.23.0 to be installed in order to work.
- The website was integrated with [Crowdin](https://crowdin.com/project/taskfile) to allow the community to contribute with translations! [Chinese](https://taskfile.dev/zh-Hans/) is the first language available ([#1057](https://github.com/go-task/task/issues/1057), [#1058](https://github.com/go-task/task/issues/1058) by [@misitebao](https://github.com/misitebao)).
- Added task location data to the `--json` flag output ([#1056](https://github.com/go-task/task/issues/1056) by [@pd93](https://github.com/pd93))
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to `Taskfile.yml` ([#1062](https://github.com/go-task/task/issues/1062) by [@misitebao](https://github.com/misitebao)).
- Added new `splitArgs` template function (`{{splitArgs "foo bar 'foo bar
baz'"}}`) to ensure string is split as arguments ([#1040](https://github.com/go-task/task/issues/1040), [#1059](https://github.com/go-task/task/issues/1059) by [@dhanusaputra](https://github.com/dhanusaputra)).
- Fix the value of `{{.CHECKSUM}}` variable in status ([#1076](https://github.com/go-task/task/issues/1076), [#1080](https://github.com/go-task/task/issues/1080) by [@pd93](https://github.com/pd93)).
- Fixed deep copy implementation ([#1072](https://github.com/go-task/task/issues/1072) by [@pd93](https://github.com/pd93))
- Created a tool to assist with releases ([#1086](https://github.com/go-task/task/issues/1086) by [@pd93](https://github.com/pd93)).
## v3.22.0 - 2023-03-10
- Add a brand new `--global` (`-g`) flag that will run a Taskfile from your `$HOME` directory. This is useful to have automation that you can run from anywhere in your system! ([Documentation](https://taskfile.dev/usage/#running-a-global-taskfile), [#1029](https://github.com/go-task/task/issues/1029) by [@andreynering](https://github.com/andreynering)).
- Add ability to set `error_only: true` on the `group` output mode. This will instruct Task to only print a command output if it returned with a non-zero exit code ([#664](https://github.com/go-task/task/issues/664), [#1022](https://github.com/go-task/task/issues/1022) by [@jaedle](https://github.com/jaedle)).
- Fixed bug where `.task/checksum` file was sometimes not being created when task also declares a `status:` ([#840](https://github.com/go-task/task/issues/840), [#1035](https://github.com/go-task/task/issues/1035) by [@harelwa](https://github.com/harelwa), [#1037](https://github.com/go-task/task/issues/1037) by [@pd93](https://github.com/pd93)).
- Refactored and decoupled fingerprinting from the main Task executor ([#1039](https://github.com/go-task/task/issues/1039) by [@pd93](https://github.com/pd93)).
- Fixed deadlock issue when using `run: once` ([#715](https://github.com/go-task/task/issues/715), [#1025](https://github.com/go-task/task/issues/1025) by [@theunrepentantgeek](https://github.com/theunrepentantgeek)).
## v3.21.0 - 2023-02-22
- Added new `TASK_VERSION` special variable ([#990](https://github.com/go-task/task/issues/990), [#1014](https://github.com/go-task/task/issues/1014) by [@ja1code](https://github.com/ja1code)).
- Fixed a bug where tasks were sometimes incorrectly marked as internal ([#1007](https://github.com/go-task/task/issues/1007) by [@pd93](https://github.com/pd93)).
- Update to Go 1.20 (bump minimum version to 1.19) ([#1010](https://github.com/go-task/task/issues/1010) by [@pd93](https://github.com/pd93))
- Added environment variable `FORCE_COLOR` support to force color output. Usefull for environments without TTY ([#1003](https://github.com/go-task/task/issues/1003) by [@automation](https://github.com/automation)-stack)
## v3.20.0 - 2023-01-14
- Improve behavior and performance of status checking when using the `timestamp` mode ([#976](https://github.com/go-task/task/issues/976), [#977](https://github.com/go-task/task/issues/977) by [@aminya](https://github.com/aminya)).
- Performance optimizations were made for large Taskfiles ([#982](https://github.com/go-task/task/issues/982) by [@pd93](https://github.com/pd93)).
- Add ability to configure options for the [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) and [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) builtins ([#908](https://github.com/go-task/task/issues/908), [#929](https://github.com/go-task/task/issues/929) by [@pd93](https://github.com/pd93), [Documentation](http://taskfile.dev/usage/#set-and-shopt)).
- Add new `platforms:` attribute to `task` and `cmd`, so it's now possible to choose in which platforms that given task or command will be run on. Possible values are operating system (GOOS), architecture (GOARCH) or a combination of the two. Example: `platforms: [linux]`, `platforms: [amd64]` or `platforms:
[linux/amd64]`. Other platforms will be skipped ([#978](https://github.com/go-task/task/issues/978), [#980](https://github.com/go-task/task/issues/980) by [@leaanthony](https://github.com/leaanthony)).
## v3.19.1 - 2022-12-31
- Small bug fix: closing `Taskfile.yml` once we're done reading it ([#963](https://github.com/go-task/task/issues/963), [#964](https://github.com/go-task/task/issues/964) by [@HeCorr](https://github.com/HeCorr)).
- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file ([#961](https://github.com/go-task/task/issues/961), [#971](https://github.com/go-task/task/issues/971) by [@pd93](https://github.com/pd93)).
- Fixed a bug where watch intervals set in the Taskfile were not being respected ([#969](https://github.com/go-task/task/issues/969), [#970](https://github.com/go-task/task/issues/970) by [@pd93](https://github.com/pd93))
- Add `--json` flag (alias `-j`) with the intent to improve support for code editors and add room to other possible integrations. This is basic for now, but we plan to add more info in the near future ([#936](https://github.com/go-task/task/issues/936) by [@davidalpert](https://github.com/davidalpert), [#764](https://github.com/go-task/task/issues/764)).
## v3.19.0 - 2022-12-05
- Installation via npm now supports [pnpm](https://pnpm.io/) as well ([go-task/go-npm\[#2\](https://github.com/go-task/task/issues/2)](https://github.com/go-task/go-npm/issues/2), [go-task/go-npm\[#3\](https://github.com/go-task/task/issues/3)](https://github.com/go-task/go-npm/pull/3)).
- It's now possible to run Taskfiles from subdirectories! A new `USER_WORKING_DIR` special variable was added to add even more flexibility for monorepos ([#289](https://github.com/go-task/task/issues/289), [#920](https://github.com/go-task/task/issues/920)).
- Add task-level `dotenv` support ([#389](https://github.com/go-task/task/issues/389), [#904](https://github.com/go-task/task/issues/904)).
- It's now possible to use global level variables on `includes` ([#942](https://github.com/go-task/task/issues/942), [#943](https://github.com/go-task/task/issues/943)).
- The website got a brand new [translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by [\[@DeronW\](https://github.com/DeronW)](https://github.com/DeronW). Thanks!
## v3.18.0 - 2022-11-12
- Show aliases on `task --list --silent` (`task --ls`). This means that aliases will be completed by the completion scripts ([#919](https://github.com/go-task/task/issues/919)).
- Tasks in the root Taskfile will now be displayed first in `--list`/`--list-all` output ([#806](https://github.com/go-task/task/issues/806), [#890](https://github.com/go-task/task/issues/890)).
- It's now possible to call a `default` task in an included Taskfile by using just the namespace. For example: `docs:default` is now automatically aliased to `docs` ([#661](https://github.com/go-task/task/issues/661), [#815](https://github.com/go-task/task/issues/815)).
## v3.17.0 - 2022-10-14
- Add a "Did you mean ...?" suggestion when a task does not exits another one with a similar name is found ([#867](https://github.com/go-task/task/issues/867), [#880](https://github.com/go-task/task/issues/880)).
- Now YAML parse errors will print which Taskfile failed to parse ([#885](https://github.com/go-task/task/issues/885), [#887](https://github.com/go-task/task/issues/887)).
- Add ability to set `aliases` for tasks and namespaces ([#268](https://github.com/go-task/task/issues/268), [#340](https://github.com/go-task/task/issues/340), [#879](https://github.com/go-task/task/issues/879)).
- Improvements to Fish shell completion ([#897](https://github.com/go-task/task/issues/897)).
- Added ability to set a different watch interval by setting `interval: '500ms'` or using the `--interval=500ms` flag ([#813](https://github.com/go-task/task/issues/813), [#865](https://github.com/go-task/task/issues/865)).
- Add colored output to `--list`, `--list-all` and `--summary` flags ([#845](https://github.com/go-task/task/issues/845), [#874](https://github.com/go-task/task/issues/874)).
- Fix unexpected behavior where `label:` was being shown instead of the task name on `--list` ([#603](https://github.com/go-task/task/issues/603), [#877](https://github.com/go-task/task/issues/877)).
## v3.16.0 - 2022-09-29
- Add `npm` as new installation method: `npm i -g [@go](https://github.com/go)-task/cli` ([#870](https://github.com/go-task/task/issues/870), [#871](https://github.com/go-task/task/issues/871), [npm package](https://www.npmjs.com/package/[@go](https://github.com/go)-task/cli)).
- Add support to marking tasks and includes as internal, which will hide them from `--list` and `--list-all` ([#818](https://github.com/go-task/task/issues/818)).
## v3.15.2 - 2022-09-08
- Fix error when using variable in `env:` introduced in the previous release ([#858](https://github.com/go-task/task/issues/858), [#866](https://github.com/go-task/task/issues/866)).
- Fix handling of `CLI_ARGS` (`--`) in Bash completion ([#863](https://github.com/go-task/task/issues/863)).
- On zsh completion, add ability to replace `--list-all` with `--list` as already possible on the Bash completion ([#861](https://github.com/go-task/task/issues/861)).
## v3.15.0 - 2022-09-03
- Add new special variables `ROOT_DIR` and `TASKFILE_DIR`. This was a highly requested feature ([#215](https://github.com/go-task/task/issues/215), [#857](https://github.com/go-task/task/issues/857), [Documentation](https://taskfile.dev/api/#special-variables)).
- Follow symlinks on `sources` ([#826](https://github.com/go-task/task/issues/826), [#831](https://github.com/go-task/task/issues/831)).
- Improvements and fixes to Bash completion ([#835](https://github.com/go-task/task/issues/835), [#844](https://github.com/go-task/task/issues/844)).
## v3.14.1 - 2022-08-03
- Always resolve relative include paths relative to the including Taskfile ([#822](https://github.com/go-task/task/issues/822), [#823](https://github.com/go-task/task/issues/823)).
- Fix ZSH and PowerShell completions to consider all tasks instead of just the public ones (those with descriptions) ([#803](https://github.com/go-task/task/issues/803)).
## v3.14.0 - 2022-07-08
- Add ability to override the `.task` directory location with the `TASK_TEMP_DIR` environment variable.
- Allow to override Task colors using environment variables: `TASK_COLOR_RESET`, `TASK_COLOR_BLUE`, `TASK_COLOR_GREEN`, `TASK_COLOR_CYAN`, `TASK_COLOR_YELLOW`, `TASK_COLOR_MAGENTA` and `TASK_COLOR_RED` ([#568](https://github.com/go-task/task/issues/568), [#792](https://github.com/go-task/task/issues/792)).
- Fixed bug when using the `output: group` mode where STDOUT and STDERR were being print in separated blocks instead of in the right order ([#779](https://github.com/go-task/task/issues/779)).
- Starting on this release, ARM architecture binaries are been released to Snap as well ([#795](https://github.com/go-task/task/issues/795)).
- i386 binaries won't be available anymore on Snap because Ubuntu removed the support for this architecture.
- Upgrade mvdan.cc/sh, which fixes a bug with associative arrays ([#785](https://github.com/go-task/task/issues/785), [mvdan/sh\[#884\](https://github.com/go-task/task/issues/884)](https://github.com/mvdan/sh/issues/884), [mvdan/sh\[#893\](https://github.com/go-task/task/issues/893)](https://github.com/mvdan/sh/pull/893)).
## v3.13.0 - 2022-06-13
- Added `-n` as an alias to `--dry` ([#776](https://github.com/go-task/task/issues/776), [#777](https://github.com/go-task/task/issues/777)).
- Fix behavior of interrupt (SIGINT, SIGTERM) signals. Task will now give time for the processes running to do cleanup work ([#458](https://github.com/go-task/task/issues/458), [#479](https://github.com/go-task/task/issues/479), [#728](https://github.com/go-task/task/issues/728), [#769](https://github.com/go-task/task/issues/769)).
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the command being ran ([#755](https://github.com/go-task/task/issues/755)).
## v3.12.1 - 2022-05-10
- Fixed bug where, on Windows, variables were ending with `\r` because we were only removing the final `\n` but not `\r\n` ([#717](https://github.com/go-task/task/issues/717)).
## v3.12.0 - 2022-03-31
- The `--list` and `--list-all` flags can now be combined with the `--silent` flag to print the task names only, without their description ([#691](https://github.com/go-task/task/issues/691)).
- Added support for multi-level inclusion of Taskfiles. This means that included Taskfiles can also include other Taskfiles. Before this was limited to one level ([#390](https://github.com/go-task/task/issues/390), [#623](https://github.com/go-task/task/issues/623), [#656](https://github.com/go-task/task/issues/656)).
- Add ability to specify vars when including a Taskfile. [Check out the documentation](https://taskfile.dev/#/usage?id=vars-of-included-taskfiles) for more information ([#677](https://github.com/go-task/task/issues/677)).
## v3.11.0 - 2022-02-19
- Task now supports printing begin and end messages when using the `group` output mode, useful for grouping tasks in CI systems. [Check out the documentation](http://taskfile.dev/#/usage?id=output-syntax) for more information ([#647](https://github.com/go-task/task/issues/647), [#651](https://github.com/go-task/task/issues/651)).
- Add `Taskfile.dist.yml` and `Taskfile.dist.yaml` to the supported file name list. [Check out the documentation](https://taskfile.dev/#/usage?id=supported-file-names) for more information ([#498](https://github.com/go-task/task/issues/498), [#666](https://github.com/go-task/task/issues/666)).
## v3.10.0 - 2022-01-04
- A new `--list-all` (alias `-a`) flag is now available. It's similar to the exiting `--list` (`-l`) but prints all tasks, even those without a description ([#383](https://github.com/go-task/task/issues/383), [#401](https://github.com/go-task/task/issues/401)).
- It's now possible to schedule cleanup commands to run once a task finishes with the `defer:` keyword ([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer), [#475](https://github.com/go-task/task/issues/475), [#626](https://github.com/go-task/task/issues/626)).
- Remove long deprecated and undocumented `$` variable prefix and `^` command prefix ([#642](https://github.com/go-task/task/issues/642), [#644](https://github.com/go-task/task/issues/644), [#645](https://github.com/go-task/task/issues/645)).
- Add support for `.yaml` extension (as an alternative to `.yml`). This was requested multiple times throughout the years. Enjoy! ([#183](https://github.com/go-task/task/issues/183), [#184](https://github.com/go-task/task/issues/184), [#369](https://github.com/go-task/task/issues/369), [#584](https://github.com/go-task/task/issues/584), [#621](https://github.com/go-task/task/issues/621)).
- Fixed error when computing a variable when the task directory do not exist yet ([#481](https://github.com/go-task/task/issues/481), [#579](https://github.com/go-task/task/issues/579)).
## v3.9.2 - 2021-12-02
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains a fix a for a important regression on Windows ([#619](https://github.com/go-task/task/issues/619), [mvdan/sh\[#768\](https://github.com/go-task/task/issues/768)](https://github.com/mvdan/sh/issues/768), [mvdan/sh\[#769\](https://github.com/go-task/task/issues/769)](https://github.com/mvdan/sh/pull/769)).
## v3.9.1 - 2021-11-28
- Add logging in verbose mode for when a task starts and finishes ([#533](https://github.com/go-task/task/issues/533), [#588](https://github.com/go-task/task/issues/588)).
- Fix an issue with preconditions and context errors ([#597](https://github.com/go-task/task/issues/597), [#598](https://github.com/go-task/task/issues/598)).
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many ([#613](https://github.com/go-task/task/issues/613)).
- Fix nil pointer when `cmd:` was left empty ([#612](https://github.com/go-task/task/issues/612), [#614](https://github.com/go-task/task/issues/614)).
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant fixes:
- Fix quote of empty strings in `shellQuote` ([#609](https://github.com/go-task/task/issues/609), [mvdan/sh\[#763\](https://github.com/go-task/task/issues/763)](https://github.com/mvdan/sh/issues/763)).
- Fix issue of wrong environment variable being picked when there's another very similar one ([#586](https://github.com/go-task/task/issues/586), [mvdan/sh\[#745\](https://github.com/go-task/task/issues/745)](https://github.com/mvdan/sh/pull/745)).
- Install shell completions automatically when installing via Homebrew ([#264](https://github.com/go-task/task/issues/264), [#592](https://github.com/go-task/task/issues/592), [go-task/homebrew-tap\[#2\](https://github.com/go-task/task/issues/2)](https://github.com/go-task/homebrew-tap/pull/2)).
## v3.9.0 - 2021-10-02
- A new `shellQuote` function was added to the template system (`{{shellQuote "a
string"}}`) to ensure a string is safe for use in shell ([mvdan/sh\[#727\](https://github.com/go-task/task/issues/727)](https://github.com/mvdan/sh/pull/727), [mvdan/sh\[#737\](https://github.com/go-task/task/issues/737)](https://github.com/mvdan/sh/pull/737), [Documentation](https://pkg.go.dev/mvdan.cc/sh/v3[@v3](https://github.com/v3).4.0/syntax#Quote))
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with some small fixes and features
- The `read -p` flag is now supported ([#314](https://github.com/go-task/task/issues/314), [mvdan/sh\[#551\](https://github.com/go-task/task/issues/551)](https://github.com/mvdan/sh/issues/551), [mvdan/sh\[#772\](https://github.com/go-task/task/issues/772)](https://github.com/mvdan/sh/pull/722))
- The `pwd -P` and `pwd -L` flags are now supported ([#553](https://github.com/go-task/task/issues/553), [mvdan/sh\[#724\](https://github.com/go-task/task/issues/724)](https://github.com/mvdan/sh/issues/724), [mvdan/sh\[#728\](https://github.com/go-task/task/issues/728)](https://github.com/mvdan/sh/pull/728))
- The `$GID` environment variable is now correctly being set ([#561](https://github.com/go-task/task/issues/561), [mvdan/sh\[#723\](https://github.com/go-task/task/issues/723)](https://github.com/mvdan/sh/pull/723))
## v3.8.0 - 2021-09-26
- Add `interactive: true` setting to improve support for interactive CLI apps ([#217](https://github.com/go-task/task/issues/217), [#563](https://github.com/go-task/task/issues/563)).
- Fix some `nil` errors ([#534](https://github.com/go-task/task/issues/534), [#573](https://github.com/go-task/task/issues/573)).
- Add ability to declare an included Taskfile as optional ([#519](https://github.com/go-task/task/issues/519), [#552](https://github.com/go-task/task/issues/552)).
- Add support for including Taskfiles in the home directory by using `~` ([#539](https://github.com/go-task/task/issues/539), [#557](https://github.com/go-task/task/issues/557)).
## v3.7.3 - 2021-09-04
- Add official support to Apple M1 ([#564](https://github.com/go-task/task/issues/564), [#567](https://github.com/go-task/task/issues/567)).
- Our [official Homebrew tap](https://github.com/go-task/homebrew-tap) will support more platforms, including Apple M1
## v3.7.0 - 2021-07-31
- Add `run:` setting to control if tasks should run multiple times or not. Available options are `always` (the default), `when_changed` (if a variable modified the task) and `once` (run only once no matter what). This is a long time requested feature. Enjoy! ([#53](https://github.com/go-task/task/issues/53), [#359](https://github.com/go-task/task/issues/359)).
## v3.6.0 - 2021-07-10
- Allow using both `sources:` and `status:` in the same task ([#411](https://github.com/go-task/task/issues/411), [#427](https://github.com/go-task/task/issues/427), [#477](https://github.com/go-task/task/issues/477)).
- Small optimization and bug fix: don't compute variables if not needed for `dotenv:` ([#517](https://github.com/go-task/task/issues/517)).
## v3.5.0 - 2021-07-04
- Add support for interpolation in `dotenv:` ([#433](https://github.com/go-task/task/issues/433), [#434](https://github.com/go-task/task/issues/434), [#453](https://github.com/go-task/task/issues/453)).
## v3.4.3 - 2021-05-30
- Add support for the `NO_COLOR` environment variable. ([#459](https://github.com/go-task/task/issues/459), [fatih/color\[#137\](https://github.com/go-task/task/issues/137)](https://github.com/fatih/color/pull/137)).
- Fix bug where sources were not considering the right directory in `--watch` mode ([#484](https://github.com/go-task/task/issues/484), [#485](https://github.com/go-task/task/issues/485)).
## v3.4.2 - 2021-04-23
- On watch, report which file failed to read ([#472](https://github.com/go-task/task/issues/472)).
- Do not try to catch SIGKILL signal, which are not actually possible ([#476](https://github.com/go-task/task/issues/476)).
- Improve version reporting when building Task from source using Go Modules ([#462](https://github.com/go-task/task/issues/462), [#473](https://github.com/go-task/task/issues/473)).
## v3.4.1 - 2021-04-17
- Improve error reporting when parsing YAML: in some situations where you would just see an generic error, you'll now see the actual error with more detail: the YAML line the failed to parse, for example ([#467](https://github.com/go-task/task/issues/467)).
- A JSON Schema was published [here](https://json.schemastore.org/taskfile.json) and is automatically being used by some editors like Visual Studio Code ([#135](https://github.com/go-task/task/issues/135)).
- Print task name before the command in the log output ([#398](https://github.com/go-task/task/issues/398)).
## v3.3.0 - 2021-03-20
- Add support for delegating CLI arguments to commands with `--` and a special `CLI_ARGS` variable ([#327](https://github.com/go-task/task/issues/327)).
- Add a `--concurrency` (alias `-C`) flag, to limit the number of tasks that run concurrently. This is useful for heavy workloads. ([#345](https://github.com/go-task/task/issues/345)).
## v3.2.2 - 2021-01-12
- Improve performance of `--list` and `--summary` by skipping running shell variables for these flags ([#332](https://github.com/go-task/task/issues/332)).
- Fixed a bug where an environment in a Taskfile was not always overridable by the system environment ([#425](https://github.com/go-task/task/issues/425)).
- Fixed environment from .env files not being available as variables ([#379](https://github.com/go-task/task/issues/379)).
- The install script is now working for ARM platforms ([#428](https://github.com/go-task/task/issues/428)).
## v3.2.1 - 2021-01-09
- Fixed some bugs and regressions regarding dynamic variables and directories ([#426](https://github.com/go-task/task/issues/426)).
- The [slim-sprig](https://github.com/go-task/slim-sprig) package was updated with the upstream [sprig](https://github.com/Masterminds/sprig).
## v3.2.0 - 2021-01-07
- Fix the `.task` directory being created in the task directory instead of the Taskfile directory ([#247](https://github.com/go-task/task/issues/247)).
- Fix a bug where dynamic variables (those declared with `sh:`) were not running in the task directory when the task has a custom dir or it was in an included Taskfile ([#384](https://github.com/go-task/task/issues/384)).
- The watch feature (via the `--watch` flag) got a few different bug fixes and should be more stable now ([#423](https://github.com/go-task/task/issues/423), [#365](https://github.com/go-task/task/issues/365)).
## v3.1.0 - 2021-01-03
- Fix a bug when the checksum up-to-date resolution is used by a task with a custom `label:` attribute ([#412](https://github.com/go-task/task/issues/412)).
- Starting from this release, we're releasing official ARMv6 and ARM64 binaries for Linux ([#375](https://github.com/go-task/task/issues/375), [#418](https://github.com/go-task/task/issues/418)).
- Task now respects the order of declaration of included Taskfiles when evaluating variables declaring by them ([#393](https://github.com/go-task/task/issues/393)).
- `set -e` is now automatically set on every command. This was done to fix an issue where multiline string commands wouldn't really fail unless the sentence was in the last line ([#403](https://github.com/go-task/task/issues/403)).
## v3.0.1 - 2020-12-26
- Allow use as a library by moving the required packages out of the `internal` directory ([#358](https://github.com/go-task/task/issues/358)).
- Do not error if a specified dotenv file does not exist ([#378](https://github.com/go-task/task/issues/378), [#385](https://github.com/go-task/task/issues/385)).
- Fix panic when you have empty tasks in your Taskfile ([#338](https://github.com/go-task/task/issues/338), [#362](https://github.com/go-task/task/issues/362)).
## v3.0.0 - 2020-08-16
- On `v3`, all CLI variables will be considered global variables ([#336](https://github.com/go-task/task/issues/336), [#341](https://github.com/go-task/task/issues/341))
- Add support to `.env` like files ([#324](https://github.com/go-task/task/issues/324), [#356](https://github.com/go-task/task/issues/356)).
- Add `label:` to task so you can override the task name in the logs ([\[#321\](https://github.com/go-task/task/issues/321)](https://github.com/go-task/task/issues/321]), [#337](https://github.com/go-task/task/issues/337)).
- Refactor how variables work on version 3 ([#311](https://github.com/go-task/task/issues/311)).
- Disallow `expansions` on v3 since it has no effect.
- `Taskvars.yml` is not automatically included anymore.
- `Taskfile_{{OS}}.yml` is not automatically included anymore.
- Allow interpolation on `includes`, so you can manually include a Taskfile based on operation system, for example.
- Expose `.TASK` variable in templates with the task name ([#252](https://github.com/go-task/task/issues/252)).
- Implement short task syntax ([#194](https://github.com/go-task/task/issues/194), [#240](https://github.com/go-task/task/issues/240)).
- Added option to make included Taskfile run commands on its own directory ([#260](https://github.com/go-task/task/issues/260), [#144](https://github.com/go-task/task/issues/144))
- Taskfiles in version 1 are not supported anymore ([#237](https://github.com/go-task/task/issues/237)).
- Added global `method:` option. With this option, you can set a default method to all tasks in a Taskfile ([#246](https://github.com/go-task/task/issues/246)).
- Changed default method from `timestamp` to `checksum` ([#246](https://github.com/go-task/task/issues/246)).
- New magic variables are now available when using `status:`: `.TIMESTAMP` which contains the greatest modification date from the files listed in `sources:`, and `.CHECKSUM`, which contains a checksum of all files listed in `status:`. This is useful for manual checking when using external, or even remote, artifacts when using `status:` ([#216](https://github.com/go-task/task/issues/216)).
- We're now using [slim-sprig](https://github.com/go-task/slim-sprig) instead of [sprig](https://github.com/Masterminds/sprig), which allowed a file size reduction of about 22% ([#219](https://github.com/go-task/task/issues/219)).
- We now use some colors on Task output to better distinguish message types - commands are green, errors are red, etc ([#207](https://github.com/go-task/task/issues/207)).
## v2.8.1 - 2020-05-20
- Fix error code for the `--help` flag ([#300](https://github.com/go-task/task/issues/300), [#330](https://github.com/go-task/task/issues/330)).
- Print version to stdout instead of stderr ([#299](https://github.com/go-task/task/issues/299), [#329](https://github.com/go-task/task/issues/329)).
- Supress `context` errors when using the `--watch` flag ([#313](https://github.com/go-task/task/issues/313), [#317](https://github.com/go-task/task/issues/317)).
- Support templating on description ([#276](https://github.com/go-task/task/issues/276), [#283](https://github.com/go-task/task/issues/283)).
## v2.8.0 - 2019-12-07
- Add `--parallel` flag (alias `-p`) to run tasks given by the command line in parallel ([#266](https://github.com/go-task/task/issues/266)).
- Fixed bug where calling the `task` CLI only informing global vars would not execute the `default` task.
- Add hability to silent all tasks by adding `silent: true` a the root of the Taskfile.
## v2.7.1 - 2019-11-10
- Fix error being raised when `exit 0` was called ([#251](https://github.com/go-task/task/issues/251)).
## v2.7.0 - 2019-09-22
- Fixed panic bug when assigning a global variable ([#229](https://github.com/go-task/task/issues/229), [#243](https://github.com/go-task/task/issues/243)).
- A task with `method: checksum` will now re-run if generated files are deleted ([#228](https://github.com/go-task/task/issues/228), [#238](https://github.com/go-task/task/issues/238)).
## v2.6.0 - 2019-07-21
- Fixed some bugs regarding minor version checks on `version:`.
- Add `preconditions:` to task ([#205](https://github.com/go-task/task/issues/205)).
- Create directory informed on `dir:` if it doesn't exist ([#209](https://github.com/go-task/task/issues/209), [#211](https://github.com/go-task/task/issues/211)).
- We now have a `--taskfile` flag (alias `-t`), which can be used to run another Taskfile (other than the default `Taskfile.yml`) ([#221](https://github.com/go-task/task/issues/221)).
- It's now possible to install Task using Homebrew on Linux ([go-task/homebrew-tap\[#1\](https://github.com/go-task/task/issues/1)](https://github.com/go-task/homebrew-tap/pull/1)).
## v2.5.2 - 2019-05-11
- Reverted YAML upgrade due issues with CRLF on Windows ([#201](https://github.com/go-task/task/issues/201), [go-yaml/yaml\[#450\](https://github.com/go-task/task/issues/450)](https://github.com/go-yaml/yaml/issues/450)).
- Allow setting global variables through the CLI ([#192](https://github.com/go-task/task/issues/192)).
## 2.5.1 - 2019-04-27
- Fixed some issues with interactive command line tools, where sometimes the output were not being shown, and similar issues ([#114](https://github.com/go-task/task/issues/114), [#190](https://github.com/go-task/task/issues/190), [#200](https://github.com/go-task/task/issues/200)).
- Upgraded [go-yaml/yaml](https://github.com/go-yaml/yaml) from v2 to v3.
## v2.5.0 - 2019-03-16
- We moved from the taskfile.org domain to the new fancy taskfile.dev domain. While stuff is being redirected, we strongly recommend to everyone that use [this install script](https://taskfile.dev/#/installation?id=install-script) to use the new taskfile.dev domain on scripts from now on.
- Fixed to the ZSH completion ([#182](https://github.com/go-task/task/issues/182)).
- Add [`--summary` flag along with `summary:` task attribute](https://taskfile.org/#/usage?id=display-summary-of-task) ([#180](https://github.com/go-task/task/issues/180)).
## v2.4.0 - 2019-02-21
- Allow calling a task of the root Taskfile from an included Taskfile by prefixing it with `:` ([#161](https://github.com/go-task/task/issues/161), [#172](https://github.com/go-task/task/issues/172)).
- Add flag to override the `output` option ([#173](https://github.com/go-task/task/issues/173)).
- Fix bug where Task was persisting the new checksum on the disk when the Dry Mode is enabled ([#166](https://github.com/go-task/task/issues/166)).
- Fix file timestamp issue when the file name has spaces ([#176](https://github.com/go-task/task/issues/176)).
- Mitigating path expanding issues on Windows ([#170](https://github.com/go-task/task/issues/170)).
## v2.3.0 - 2019-01-02
- On Windows, Task can now be installed using [Scoop](https://scoop.sh/) ([#152](https://github.com/go-task/task/issues/152)).
- Fixed issue with file/directory globing ([#153](https://github.com/go-task/task/issues/153)).
- Added ability to globally set environment variables ([#138](https://github.com/go-task/task/issues/138), [#159](https://github.com/go-task/task/issues/159)).
## v2.2.1 - 2018-12-09
- This repository now uses Go Modules ([#143](https://github.com/go-task/task/issues/143)). We'll still keep the `vendor` directory in sync for some time, though;
- Fixing a bug when the Taskfile has no tasks but includes another Taskfile ([#150](https://github.com/go-task/task/issues/150));
- Fix a bug when calling another task or a dependency in an included Taskfile ([#151](https://github.com/go-task/task/issues/151)).
## v2.2.0 - 2018-10-25
- Added support for [including other Taskfiles](https://taskfile.org/#/usage?id=including-other-taskfiles) ([#98](https://github.com/go-task/task/issues/98))
- This should be considered experimental. For now, only including local files is supported, but support for including remote Taskfiles is being discussed. If you have any feedback, please comment on [#98](https://github.com/go-task/task/issues/98).
- Task now have a dedicated documentation site: https://taskfile.org
- Thanks to [Docsify](https://docsify.js.org/) for making this pretty easy. To check the source code, just take a look at the [docs](https://github.com/go-task/task/tree/master/docs) directory of this repository. Contributions to the documentation is really appreciated.
## v2.1.1 - 2018-09-17
- Fix suggestion to use `task --init` not being shown anymore (when a `Taskfile.yml` is not found)
- Fix error when using checksum method and no file exists for a source glob ([#131](https://github.com/go-task/task/issues/131))
- Fix signal handling when the `--watch` flag is given ([#132](https://github.com/go-task/task/issues/132))
## v2.1.0 - 2018-08-19
- Add a `ignore_error` option to task and command ([#123](https://github.com/go-task/task/issues/123))
- Add a dry run mode (`--dry` flag) ([#126](https://github.com/go-task/task/issues/126))
## v2.0.3 - 2018-06-24
- Expand environment variables on "dir", "sources" and "generates" ([#116](https://github.com/go-task/task/issues/116))
- Fix YAML merging syntax ([#112](https://github.com/go-task/task/issues/112))
- Add ZSH completion ([#111](https://github.com/go-task/task/issues/111))
- Implement new `output` option. Please check out the [documentation](https://github.com/go-task/task#output-syntax)
## v2.0.2 - 2018-05-01
- Fix merging of YAML anchors ([#112](https://github.com/go-task/task/issues/112))
## v2.0.1 - 2018-03-11
- Fixes panic on `task --list`
## v2.0.0 - 2018-03-08
Version 2.0.0 is here, with a new Taskfile format.
Please, make sure to read the [Taskfile versions](https://github.com/go-task/task/blob/master/TASKFILE_VERSIONS.md) document, since it describes in depth what changed for this version.
- New Taskfile version 2 ([#77](https://github.com/go-task/task/issues/77))
- Possibility to have global variables in the `Taskfile.yml` instead of `Taskvars.yml` ([#66](https://github.com/go-task/task/issues/66))
- Small improvements and fixes
## v1.4.4 - 2017-11-19
- Handle SIGINT and SIGTERM ([#75](https://github.com/go-task/task/issues/75));
- List: print message with there's no task with description;
- Expand home dir ("~" symbol) on paths ([#74](https://github.com/go-task/task/issues/74));
- Add Snap as an installation method;
- Move examples to its own repo;
- Watch: also walk on tasks called on on "cmds", and not only on "deps";
- Print logs to stderr instead of stdout ([#68](https://github.com/go-task/task/issues/68));
- Remove deprecated `set` keyword;
- Add checksum based status check, alternative to timestamp based.
## v1.4.3 - 2017-09-07
- Allow assigning variables to tasks at run time via CLI ([#33](https://github.com/go-task/task/issues/33))
- Added suport for multiline variables from sh ([#64](https://github.com/go-task/task/issues/64))
- Fixes env: remove square braces and evaluate shell ([#62](https://github.com/go-task/task/issues/62))
- Watch: change watch library and few fixes and improvements
- When use watching, cancel and restart long running process on file change ([#59](https://github.com/go-task/task/issues/59) and [#60](https://github.com/go-task/task/issues/60))
## v1.4.2 - 2017-07-30
- Flag to set directory of execution
- Always echo command if is verbose mode
- Add silent mode to disable echoing of commands
- Fixes and improvements of variables ([#56](https://github.com/go-task/task/issues/56))
## v1.4.1 - 2017-07-15
- Allow use of YAML for dynamic variables instead of $ prefix
- `VAR: {sh: echo Hello}` instead of `VAR: $echo Hello`
- Add `--list` (or `-l`) flag to print existing tasks
- OS specific Taskvars file (e.g. `Taskvars_windows.yml`, `Taskvars_linux.yml`, etc)
- Consider task up-to-date on equal timestamps ([#49](https://github.com/go-task/task/issues/49))
- Allow absolute path in generates section ([#48](https://github.com/go-task/task/issues/48))
- Bugfix: allow templating when calling deps ([#42](https://github.com/go-task/task/issues/42))
- Fix panic for invalid task in cyclic dep detection
- Better error output for dynamic variables in Taskvars.yml ([#41](https://github.com/go-task/task/issues/41))
- Allow template evaluation in parameters
## v1.4.0 - 2017-07-06
- Cache dynamic variables
- Add verbose mode (`-v` flag)
- Support to task parameters (overriding vars) ([#31](https://github.com/go-task/task/issues/31)) ([#32](https://github.com/go-task/task/issues/32))
- Print command, also when "set:" is specified ([#35](https://github.com/go-task/task/issues/35))
- Improve task command help text ([#35](https://github.com/go-task/task/issues/35))
## v1.3.1 - 2017-06-14
- Fix glob not working on commands ([#28](https://github.com/go-task/task/issues/28))
- Add ExeExt template function
- Add `--init` flag to create a new Taskfile
- Add status option to prevent task from running ([#27](https://github.com/go-task/task/issues/27))
- Allow interpolation on `generates` and `sources` attributes ([#26](https://github.com/go-task/task/issues/26))
## v1.3.0 - 2017-04-24
- Migrate from os/exec.Cmd to a native Go sh/bash interpreter
- This is a potentially breaking change if you use Windows.
- Now, `cmd` is not used anymore on Windows. Always use Bash-like syntax for your commands, even on Windows.
- Add "ToSlash" and "FromSlash" to template functions
- Use functions defined on github.com/Masterminds/sprig
- Do not redirect stdin while running variables commands
- Using `context` and `errgroup` packages (this will make other tasks to be cancelled, if one returned an error)
## v1.2.0 - 2017-04-02
- More tests and Travis integration
- Watch a task (experimental)
- Possibility to call another task
- Fix "=" not being reconized in variables/environment variables
- Tasks can now have a description, and help will print them ([#10](https://github.com/go-task/task/issues/10))
- Task dependencies now run concurrently
- Support for a default task ([#16](https://github.com/go-task/task/issues/16))
## v1.1.0 - 2017-03-08
- Support for YAML, TOML and JSON ([#1](https://github.com/go-task/task/issues/1))
- Support running command in another directory ([#4](https://github.com/go-task/task/issues/4))
- `--force` or `-f` flag to force execution of task even when it's up-to-date
- Detection of cyclic dependencies ([#5](https://github.com/go-task/task/issues/5))
- Support for variables ([#6](https://github.com/go-task/task/issues/6), [#9](https://github.com/go-task/task/issues/9), [#14](https://github.com/go-task/task/issues/14))
- Operation System specific commands and variables ([#13](https://github.com/go-task/task/issues/13))
## v1.0.0 - 2017-02-28
- Add LICENSE file

View File

@ -0,0 +1,50 @@
---
slug: /community/
sidebar_position: 8
---
# Community
Some of the work to improve the Task ecosystem is done by the community, be it installation methods or integrations with code editor. I (the author) am thankful for everyone that helps me to improve the overall experience.
## Translations
[@DeronW](https://github.com/DeronW) maintains the [Chinese translation](https://task-zh.readthedocs.io/zh_CN/latest/) of the website [on this repository](https://github.com/DeronW/task).
## Editor Integrations
### JSON Schema
Initial work on the schema was made by [@KROSF](https://github.com/KROSF) on [this Gist](https://gist.github.com/KROSF/c5435acf590acd632f71bb720f685895). The schema is currently available at https://taskfile.dev/schema.json and linked at https://json.schemastore.org/taskfile.json so it is be used automatically many code editors, like VSCode. Contributions can be done by editing [this file](https://github.com/go-task/task/blob/master/docs/static/schema.json).
### Visual Studio Code extension
Additionally, there's also some work done by [@paulvarache](https://github.com/paulvarache) in making an Visual Studio Code extension, which has its code [here](https://github.com/paulvarache/vscode-taskfile) and is published [here](https://marketplace.visualstudio.com/items?itemName=paulvarache.vscode-taskfile).
### Sublime Text 4 package
There is a convenience wrapper for initializing and running tasks from Sublime Text's command palette. The package is developed by [@biozz](https://github.com/biozz), the source code is available [here](https://github.com/biozz/sublime-taskfile) and it is published on Package Control [here](https://packagecontrol.io/packages/Taskfile).
### IntelliJ plugin
There's a JetBrains IntelliJ plugin done by [@lechuckroh](https://github.com/lechuckroh), which has its code [here](https://github.com/lechuckroh/task-intellij-plugin) and is published [here](https://plugins.jetbrains.com/plugin/17058-taskfile).
## Other Integrations
- [mk](https://github.com/pycontribs/mk) command line tool recognizes Taskfiles natively.
## Installation methods
Some installation methods are maintained by third party:
- [GitHub Actions](https://github.com/arduino/setup-task) by [@arduino](https://github.com/arduino)
- [AUR](https://aur.archlinux.org/packages/go-task-bin) by [@carlsmedstad](https://github.com/carlsmedstad)
- [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)
- [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
- [NixOS](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/go-task/default.nix)
## More
Also, thanks for all the [code contributors](https://github.com/go-task/task/graphs/contributors), [financial contributors](https://opencollective.com/task), all those who [reported bugs](https://github.com/go-task/task/issues?q=is%3Aissue) and [answered questions](https://github.com/go-task/task/discussions).
If you know something that is missing in this document, please submit a pull request.

View File

@ -0,0 +1,69 @@
---
slug: /contributing/
sidebar_position: 9
---
# Contributing
Contributions to Task are very welcome, but we ask that you read this document before submitting a PR.
## Before you start
- **Check existing work** - Is there an existing PR? Are there issues discussing the feature/change you want to make? Please make sure you consider/address these discussions in your work.
- **Backwards compatibility** - Will your change break existing Taskfiles? It is much more likely that your change will merged if it backwards compatible. Is there an approach you can take that maintains this compatibility? If not, consider opening an issue first so that API changes can be discussed before you invest your time into a PR.
## 1. Setup
- **Go** - Task is written in [Go](https://go.dev). We always support the latest two major Go versions, so make sure your version is recent enough.
- **Node.js** - [Node.js](https://nodejs.org/en/) is used to host Task's documentation server and is required if you want to run this server locally.
- **Yarn** - [Yarn](https://yarnpkg.com/) is the Node.js package manager used by Task.
## 2. Making changes
- **Code style** - Try to maintain the existing code style where possible and ensure that code is formatted by `gofmt`. We use `golangci-lint` in our CI to enforce a consistent style and best-practice. There's a `lint` command in the Taskfile to run this locally.
- **Documentation** - Ensure that you add/update any relevant documentation. See the [updating documentation](#updating-documentation) section below.
- **Tests** - Ensure that you add/update any relevant tests and that all tests are passing before submitting the PR. See the [writing tests](#writing-tests) section below.
### Running your changes
To run Task with working changes, you can use `go run ./cmd/task`. To run a development build of task against a test Taskfile in `testdata`, you can use `go
run ./cmd/task --dir ./testdata/<my_test_dir> <task_name>`.
### Updating documentation
Task uses [Docusaurus](https://docusaurus.io) to host a documentation server. This can be setup and run locally by using `task docs` (requires `nodejs` & `yarn`). All content is written in Markdown and is located in the `docs/docs` directory. All Markdown documents should have an 80 character line wrap limit.
When making a change, consider whether a change to the [Usage Guide](./usage.md) is necessary. This document contains descriptions and examples of how to use Task features. If you're adding a new feature, try to find an appropriate place to add a new section. If you're updating an existing feature, ensure that the documentation and any examples are up-to-date. Ensure that any examples follow the [Taskfile Styleguide](./styleguide.md).
If you added a new field, command or flag, ensure that you add it to the [API Reference](./api_reference.md). New fields also need to be added to the [JSON Schema](https://github.com/go-task/task/blob/master/docs/static/schema.json). The descriptions for fields in the API reference and the schema should match.
### Writing tests
Most of Task's test are held in the `task_test.go` file in the project root and this is where you'll most likely want to add new ones too. Most of these tests also have a subdirectory in the `testdata` directory where any Taskfiles/data required to run the tests are stored.
When making a changes, consider whether new tests are required. These tests should ensure that the functionality you are adding will continue to work in the future. Existing tests may also need updating if you have changed Task's behaviour.
## 3. Committing your code
Try to write meaningful commit messages and avoid having too many commits on the PR. Most PRs should likely have a single commit (although for bigger PRs it may be reasonable to split it in a few). Git squash and rebase is your friend!
## 4. Submitting a PR
- **Describe your changes** - Ensure that you provide a comprehensive description of your changes.
- **Issue/PR links** - Link any previous work such as related issues or PRs. Please describe how your changes differ to/extend this work.
- **Examples** - Add any examples that you think are useful to demonstrate the effect of your changes.
- **Draft PRs** - If your changes are incomplete, but you would like to discuss them, open the PR as a draft and add a comment to start a discussion. Using comments rather than the PR description allows the description to be updated later while preserving any discussions.
## FAQ
> I want to contribute, where do I start?
Take a look at the list of [open issues](https://github.com/go-task/task/issues). We have a [good first issue](https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label for simpler issues that are ideal for first time contributions.
All kinds of contributions are welcome, whether its a typo fix or a shiny new feature. You can also contribute by upvoting/commenting on issues, helping to answer questions or contributing to other [community projects](./community.md).
> I'm stuck, where can I get help?
If you have questions, feel free to ask them in the `#help` forum channel on our [Discord server](https://discord.gg/6TY36E39UK) or open a [Discussion](https://github.com/go-task/task/discussions) on GitHub.
---

View File

@ -0,0 +1,39 @@
---
slug: /donate/
sidebar_position: 12
---
# Donate
If you find this project useful, you can consider donating by using one of the channels listed below.
This is just a way of saying "thank you", it won't give you any benefits like higher priority on issues or something similar.
Companies who donate at least $50/month will be featured as a "Gold Sponsor" in the website homepage and on the GitHub repository README. Make contact with [@andreynering](https://github.com/andreynering) with the logo you want to be shown. Suspect businesses (gambling, casinos, etc) won't be allowed, though.
## GitHub Sponsors
The preferred way to donate to the maintainers is via GitHub Sponsors. Just use the following links to do your donation:
- [@andreynering](https://github.com/sponsors/andreynering)
- [@pd93](https://github.com/sponsors/pd93)
## Open Collective
If you prefer [Open Collective](https://opencollective.com/task) you can donate by using these links:
- [$2 per month](https://opencollective.com/task/contribute/backer-4034/checkout)
- [$5 per month](https://opencollective.com/task/contribute/supporter-8404/checkout)
- [$20 per month](https://opencollective.com/task/contribute/sponsor-4035/checkout)
- [$50 per month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
- [Custom value - One-time donation option supported](https://opencollective.com/task/donate)
## PayPal
You can donate to [@andreynering](https://github.com/andreynering) via PayPal as well:
- [Any value - One-time donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url)
## PIX (Brazil only)
And if you're Brazilian, you can also donate to [@andreynering](https://github.com/andreynering) via PIX by [using this QR Code](/img/pix.png).

View File

@ -0,0 +1,40 @@
---
slug: /faq/
sidebar_position: 5
---
# FAQ
This page contains a list of frequently asked questions about Task.
- [Why won't my task update my shell environment?](#why-wont-my-task-update-my-shell-environment)
- ['x' builtin command doesn't work on Windows](#x-builtin-command-doesnt-work-on-windows)
## Why won't my task update my shell environment?
This is a limitation of how shells work. Task runs as a subprocess of your current shell, so it can't change the environment of the shell that started it. This limitation is shared by other task runners and build tools too.
A common way to work around this is to create a task that will generate output that can be parsed by your shell. For example, to set an environment variable on your shell you can write a task like this:
```yaml
my-shell-env:
cmds:
- echo "export FOO=foo"
- echo "export BAR=bar"
```
Now run `eval $(task my-shell-env)` and the variables `$FOO` and `$BAR` will be available in your shell.
## 'x' builtin command doesn't work on Windows
The default shell on Windows (`cmd` and `powershell`) do not have commands like `rm` and `cp` available as builtins. This means that these commands won't work. If you want to make your Taskfile fully cross-platform, you'll need to work around this limitation using one of the following methods:
- Use the `{{OS}}` function to run an OS-specific script.
- Use something like `{{if eq OS "windows"}}powershell {{end}}<my_cmd>` to detect windows and run the command in Powershell directly.
- Use a shell on Windows that supports these commands as builtins, such as [Git Bash](https://gitforwindows.org/) or [WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
We want to make improvements to this part of Task and the issues below track this work. Constructive comments and contributions are very welcome!
- [#197](https://github.com/go-task/task/issues/197)
- [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
- [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)

View File

@ -0,0 +1,231 @@
---
slug: /installation/
sidebar_position: 2
---
# Installation
Task offers many installation methods. Check out the available methods below.
## Package Managers
### Homebrew
If you're on macOS or Linux and have [Homebrew](https://brew.sh/) installed, getting Task is as simple as running:
```bash
brew install go-task/tap/go-task
```
The above Formula is [maintained by ourselves](https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb).
Recently, Task was also made available [on the official Homebrew repository](https://formulae.brew.sh/formula/go-task), so you also have that option if you prefer:
```bash
brew install go-task
```
### Snap
Task is available in [Snapcraft](https://snapcraft.io/task), but keep in mind that your Linux distribution should allow classic confinement for Snaps to Task work right:
```bash
sudo snap install task --classic
```
### Chocolatey
If you're on Windows and have [Chocolatey](https://chocolatey.org/) installed, getting Task is as simple as running:
```bash
choco install go-task
```
This installation method is community owned.
### Scoop
If you're on Windows and have [Scoop](https://scoop.sh/) installed, getting Task is as simple as running:
```cmd
scoop install task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available on Scoop.
### AUR
If you're on Arch Linux you can install Task from [AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite package manager such as `yay`, `pacaur` or `yaourt`:
```cmd
yay -S go-task-bin
```
Alternatively, there's [this package](https://aur.archlinux.org/packages/go-task) which installs from the source code instead of downloading the binary from the [releases page](https://github.com/go-task/task/releases):
```cmd
yay -S go-task
```
This installation method is community owned.
### Fedora
If you're on Fedora Linux you can install Task from the official [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/) repository using `dnf`:
```cmd
sudo dnf install go-task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/).
### Nix
If you're on NixOS or have Nix installed you can install Task from [nixpkgs](https://github.com/NixOS/nixpkgs):
```cmd
nix-env -iA nixpkgs.go-task
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [nixpkgs](https://github.com/NixOS/nixpkgs).
### npm
You can also use Node and npm to install Task by installing [this package](https://www.npmjs.com/package/@go-task/cli).
```bash
npm install -g @go-task/cli
```
## Get The Binary
### Binary
You can download the binary from the [releases page on GitHub](https://github.com/go-task/task/releases) and add to your `$PATH`.
DEB and RPM packages are also available.
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
### Install Script
We also have an [install script](https://github.com/go-task/task/blob/master/install-task.sh) which is very useful in scenarios like CI. Many thanks to [GoDownloader](https://github.com/goreleaser/godownloader) for enabling the easy generation of this script.
By default, it installs on the `./bin` directory relative to the working directory:
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
```
It is possible to override the installation directory with the `-b` parameter. On Linux, common choices are `~/.local/bin` and `~/bin` to install for the current user or `/usr/local/bin` to install for all users:
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
```
:::caution
On macOS and Windows, `~/.local/bin` and `~/bin` are not added to `$PATH` by default.
:::
### GitHub Actions
If you want to install Task in GitHub Actions you can try using [this action](https://github.com/arduino/setup-task) by the Arduino team:
```yaml
- name: Install Task
uses: arduino/setup-task@v1
```
This installation method is community owned.
## Build From Source
### Go Modules
Ensure that you have a supported version of [Go](https://golang.org/) properly installed and setup. You can find the minimum required version of Go in the [go.mod](https://github.com/go-task/task/blob/master/go.mod#L3) file.
You can then install the latest release globally by running:
```bash
go install github.com/go-task/task/v3/cmd/task@latest
```
Or you can install into another directory:
```bash
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
```
:::tip
For CI environments we recommend using the [install script](#get-the-binary) instead, which is faster and more stable, since it'll just download the latest released binary.
:::
## Setup completions
Download the autocompletion file corresponding to your shell.
[All completions are available on the Task repository](https://github.com/go-task/task/tree/master/completion).
### Bash
First, ensure that you installed bash-completion using your package manager.
Make the completion file executable:
```
chmod +x path/to/task.bash
```
After, add this to your `~/.bash_profile`:
```shell
source path/to/task.bash
```
### ZSH
Put the `_task` file somewhere in your `$FPATH`:
```shell
mv path/to/_task /usr/local/share/zsh/site-functions/_task
```
Ensure that the following is present in your `~/.zshrc`:
```shell
autoload -U compinit
compinit -i
```
ZSH version 5.7 or later is recommended.
### Fish
Move the `task.fish` completion script:
```shell
mv path/to/task.fish ~/.config/fish/completions/task.fish
```
### PowerShell
Open your profile script with:
```
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
notepad $profile
```
Add the line and save the file:
```shell
Invoke-Expression -Command path/to/task.ps1
```

View File

@ -0,0 +1,48 @@
---
slug: /
sidebar_position: 1
title: Home
---
# Task
<div align="center">
<img id="logo" src="img/logo.svg" height="250px" width="250px" />
</div>
Task is a task runner / build tool that aims to be simpler and easier to use than, for example, [GNU Make](https://www.gnu.org/software/make/).
Since it's written in [Go](https://go.dev/), Task is just a single binary and has no other dependencies, which means you don't need to mess with any complicated install setups just to use a build tool.
Once [installed](installation.md), you just need to describe your build tasks using a simple [YAML](http://yaml.org/) schema in a file called `Taskfile.yml`:
```yaml title="Taskfile.yml"
version: '3'
tasks:
hello:
cmds:
- echo 'Hello World from Task!'
silent: true
```
And call it by running `task hello` from your terminal.
The above example is just the start, you can take a look at the [usage](/usage) guide to check the full schema documentation and Task features.
## Features
- [Easy installation](installation.md): just download a single binary, add to `$PATH` and you're done! Or you can also install using [Homebrew](https://brew.sh/), [Snapcraft](https://snapcraft.io/), or [Scoop](https://scoop.sh/) if you want.
- Available on CIs: by adding [this simple command](installation.md#install-script) to install on your CI script and you're ready to use Task as part of your CI pipeline;
- Truly cross-platform: while most build tools only work well on Linux or macOS, Task also supports Windows thanks to [this shell interpreter for Go](https://github.com/mvdan/sh).
- Great for code generation: you can easily [prevent a task from running](/usage#prevent-unnecessary-work) if a given set of files haven't changed since last run (based either on its timestamp or content).
## Gold Sponsors
<div class="gold-sponsors">
| [Appwrite](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
| ---------------------------------------------------------------------------------------------------------------------------- |
| [![Appwrite](/img/appwrite.svg)](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
</div>

View File

@ -0,0 +1,35 @@
---
slug: /releasing/
sidebar_position: 10
---
# Releasing
The release process of Task is done with the help of [GoReleaser](https://goreleaser.com/). You can test the release process locally by calling the `test-release` task of the Taskfile.
[GitHub Actions](https://github.com/go-task/task/actions) should release artifacts automatically when a new Git tag is pushed to master (raw executables and DEB and RPM packages).
Since v3.15.0, raw executables can also be reproduced and verified locally by checking out a specific tag and calling `goreleaser build`, using the Go version defined in the above GitHub Actions.
# Homebrew
Goreleaser will automatically push a new commit to the [Formula/go-task.rb](https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb) file in the [Homebrew tap](https://github.com/go-task/homebrew-tap) repository to release the new version.
# npm
To release to npm update the version in the [`package.json`](https://github.com/go-task/task/blob/master/package.json#L3) file and then run `task npm:publish` to push it.
# Snapcraft
The [snap package](https://github.com/go-task/snap) requires to manual steps to release a new version:
* Updating the current version on [snapcraft.yaml](https://github.com/go-task/snap/blob/master/snap/snapcraft.yaml#L2).
* Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel on the [Snapcraft dashboard](https://snapcraft.io/task/releases).
# Scoop
Scoop is a command-line package manager for the Windows operating system. Scoop package manifests are maintained by the community. Scoop owners usually take care of updating versions there by editing [this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json). If you think its Task version is outdated, open an issue to let us know.
# Nix
Nix is a community owned installation method. Nix package maintainers usually take care of updating versions there by editing [this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/tools/go-task/default.nix). If you think its Task version is outdated, open an issue to let us know.

View File

@ -0,0 +1,209 @@
---
slug: /styleguide/
sidebar_position: 6
---
# Styleguide
This is the official Task styleguide for `Taskfile.yml` files. This guide contains some basic instructions to keep your Taskfile clean and familiar to other users.
This contains general guidelines, but they don't necessarily need to be strictly followed. Feel free to disagree and proceed differently at some point if you need or want to. Also, feel free to open issues or pull requests with improvements to this guide.
## Use `Taskfile.yml` and not `taskfile.yml`
```yaml
# bad
taskfile.yml
# good
Taskfile.yml
```
This is important especially for Linux users. Windows and macOS have case insensitive filesystems, so `taskfile.yml` will end up working, even that not officially supported. On Linux, only `Taskfile.yml` will work, though.
## Use the correct order of keywords
- `version:`
- `includes:`
- Configuration ones, like `output:`, `silent:`, `method:` and `run:`
- `vars:`
- `env:`, `dotenv:`
- `tasks:`
## Use 2 spaces for indentation
This is the most common convention for YAML files, and Task follows it.
```yaml
# bad
tasks:
foo:
cmds:
- echo 'foo'
# good
tasks:
foo:
cmds:
- echo 'foo'
```
## Separate with spaces the mains sections
```yaml
# bad
version: '3'
includes:
docker: ./docker/Taskfile.yml
output: prefixed
vars:
FOO: bar
env:
BAR: baz
tasks:
# ...
# good
version: '3'
includes:
docker: ./docker/Taskfile.yml
output: prefixed
vars:
FOO: bar
env:
BAR: baz
tasks:
# ...
```
## Add spaces between tasks
```yaml
# bad
version: '3'
tasks:
foo:
cmds:
- echo 'foo'
bar:
cmds:
- echo 'bar'
baz:
cmds:
- echo 'baz'
# good
version: '3'
tasks:
foo:
cmds:
- echo 'foo'
bar:
cmds:
- echo 'bar'
baz:
cmds:
- echo 'baz'
```
## Use upper-case variable names
```yaml
# bad
version: '3'
vars:
binary_name: myapp
tasks:
build:
cmds:
- go build -o {{.binary_name}} .
# good
version: '3'
vars:
BINARY_NAME: myapp
tasks:
build:
cmds:
- go build -o {{.BINARY_NAME}} .
```
## Don't wrap vars in spaces when templating
```yaml
# bad
version: '3'
tasks:
greet:
cmds:
- echo '{{ .MESSAGE }}'
# good
version: '3'
tasks:
greet:
cmds:
- echo '{{.MESSAGE}}'
```
This convention is also used by most people for any Go templating.
## Separate task name words with a dash
```yaml
# bad
version: '3'
tasks:
do_something_fancy:
cmds:
- echo 'Do something'
# good
version: '3'
tasks:
do-something-fancy:
cmds:
- echo 'Do something'
```
## Use colon for task namespacing
```yaml
# good
version: '3'
tasks:
docker:build:
cmds:
- docker ...
docker:run:
cmds:
- docker-compose ...
```
This is also done automatically when using included Taskfiles.

View File

@ -0,0 +1,204 @@
---
slug: /taskfile-versions/
sidebar_position: 11
---
# Taskfile Versions
The Taskfile syntax and features changed with time. This document explains what changed on each version and how to upgrade your Taskfile.
## What the Taskfile version mean
The Taskfile version follows the Task version. E.g. the change to Taskfile version `2` means that Task `v2.0.0` should be release to support it.
The `version:` key on Taskfile accepts a semver string, so either `2`, `2.0` or `2.0.0` is accepted. If you choose to use `2.0` Task will not enable future `2.1` features, but if you choose to use `2`, then any `2.x.x` features will be available, but not `3.0.0+`.
## Version 1
> NOTE: Taskfiles in version 1 are not supported on Task >= v3.0.0 anymore.
In the first version of the `Taskfile`, the `version:` key was not available, because the tasks was in the root of the YAML document. Like this:
```yaml
echo:
cmds:
- echo "Hello, World!"
```
The variable priority order was also different:
1. Call variables
2. Environment
3. Task variables
4. `Taskvars.yml` variables
## Version 2.0
At version 2, we introduced the `version:` key, to allow us to evolve Task with new features without breaking existing Taskfiles. The new syntax is as follows:
```yaml
version: '2'
tasks:
echo:
cmds:
- echo "Hello, World!"
```
Version 2 allows you to write global variables directly in the Taskfile, if you don't want to create a `Taskvars.yml`:
```yaml
version: '2'
vars:
GREETING: Hello, World!
tasks:
greet:
cmds:
- echo "{{.GREETING}}"
```
The variable priority order changed to the following:
1. Task variables
2. Call variables
3. Taskfile variables
4. Taskvars file variables
5. Environment variables
A new global option was added to configure the number of variables expansions (which default to 2):
```yaml
version: '2'
expansions: 3
vars:
FOO: foo
BAR: bar
BAZ: baz
FOOBAR: "{{.FOO}}{{.BAR}}"
FOOBARBAZ: "{{.FOOBAR}}{{.BAZ}}"
tasks:
default:
cmds:
- echo "{{.FOOBARBAZ}}"
```
## Version 2.1
Version 2.1 includes a global `output` option, to allow having more control over how commands output are printed to the console (see [documentation](usage.md#output-syntax) for more info):
```yaml
version: '2'
output: prefixed
tasks:
server:
cmds:
- go run main.go
prefix: server
```
From this version it's also possible to ignore errors of a command or task (check documentation [here](usage.md#ignore-errors)):
```yaml
version: '2'
tasks:
example-1:
cmds:
- cmd: exit 1
ignore_error: true
- echo "This will be print"
example-2:
cmds:
- exit 1
- echo "This will be print"
ignore_error: true
```
## Version 2.2
Version 2.2 comes with a global `includes` options to include other Taskfiles:
```yaml
version: '2'
includes:
docs: ./documentation # will look for ./documentation/Taskfile.yml
docker: ./DockerTasks.yml
```
## Version 2.6
Version 2.6 comes with `preconditions` stanza in tasks.
```yaml
version: '2'
tasks:
upload_environment:
preconditions:
- test -f .env
cmds:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation](usage.md#including-other-taskfiles)
## Version 3
These are some major changes done on `v3`:
- Task's output will now be colored
- Added support for `.env` like files
- Added `label:` setting to task so one can override how the task name appear in the logs
- A global `method:` was added to allow setting the default method, and Task's default changed to `checksum`
- Two magic variables were added when using `status:`: `CHECKSUM` and `TIMESTAMP` which contains, respectively, the md5 checksum and greatest modification timestamp of the files listed on `sources:`
- Also, the `TASK` variable is always available with the current task name
- CLI variables are always treated as global variables
- Added `dir:` option to `includes` to allow choosing on which directory an included Taskfile will run:
```yaml
includes:
docs:
taskfile: ./docs
dir: ./docs
```
- Implemented short task syntax. All below syntaxes are equivalent:
```yaml
version: '3'
tasks:
print:
cmds:
- echo "Hello, World!"
```
```yaml
version: '3'
tasks:
print:
- echo "Hello, World!"
```
```yaml
version: '3'
tasks:
print: echo "Hello, World!"
```
- There was a major refactor on how variables are handled. They're now easier to understand. The `expansions:` setting was removed as it became unncessary. This is the order in which Task will process variables, each level can see the variables set by the previous one and override those.
- Environment variables
- Global + CLI variables
- Call variables
- Task variables

View File

@ -0,0 +1,12 @@
---
slug: /translate/
sidebar_position: 13
---
# Translate
Want to help us translate this documentation? In this document we explain how.
Do NOT edit translated markdown files directly on the GitHub repository! We use [Crowdin](https://crowdin.com/project/taskfile) to allow contributors on work on translations. The repository is periodically updated with progress from Crowdin.
If you want to have access to the Crowdin project to be able to suggest translations, please ask for access on the [#translations channel on our Discord server](https://discord.gg/6TY36E39UK). If a given language is not being shown to Crowdin yet, just ask and we can configure it.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
{
"link.title.Pages": {
"message": "Pages",
"description": "The title of the footer links column with title=Pages in the footer"
},
"link.title.Community": {
"message": "Community",
"description": "The title of the footer links column with title=Community in the footer"
},
"link.title.Translations": {
"message": "Translations",
"description": "The title of the footer links column with title=Translations in the footer"
},
"link.item.label.Installation": {
"message": "Installation",
"description": "The label of footer link with label=Installation linking to /installation/"
},
"link.item.label.Usage": {
"message": "Usage",
"description": "The label of footer link with label=Usage linking to /usage/"
},
"link.item.label.Donate": {
"message": "Donate",
"description": "The label of footer link with label=Donate linking to /donate/"
},
"link.item.label.GitHub": {
"message": "GitHub",
"description": "The label of footer link with label=GitHub linking to https://github.com/go-task/task"
},
"link.item.label.Twitter": {
"message": "Twitter",
"description": "The label of footer link with label=Twitter linking to https://twitter.com/taskfiledev"
},
"link.item.label.Mastodon": {
"message": "Mastodon",
"description": "The label of footer link with label=Mastodon linking to https://fosstodon.org/@task"
},
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/6TY36E39UK"
},
"link.item.label.OpenCollective": {
"message": "OpenCollective",
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
},
"link.item.label.Chinese | 中国人": {
"message": "Chinese | 中国人",
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
}
}

View File

@ -0,0 +1,38 @@
{
"title": {
"message": "Task",
"description": "The title in the navbar"
},
"item.label.Installation": {
"message": "Installation",
"description": "Navbar item with label Installation"
},
"item.label.Usage": {
"message": "Usage",
"description": "Navbar item with label Usage"
},
"item.label.API": {
"message": "API",
"description": "Navbar item with label API"
},
"item.label.Donate": {
"message": "Donate",
"description": "Navbar item with label Donate"
},
"item.label.GitHub": {
"message": "GitHub",
"description": "Navbar item with label GitHub"
},
"item.label.Twitter": {
"message": "Twitter",
"description": "Navbar item with label Twitter"
},
"item.label.Mastodon": {
"message": "Mastodon",
"description": "Navbar item with label Mastodon"
},
"item.label.Discord": {
"message": "Discord",
"description": "Navbar item with label Discord"
}
}

View File

@ -5,95 +5,111 @@ sidebar_position: 7
# 更新日志
## v3.23.0 - 2023-03-26
Task now has an [official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task) contributed by [@pd93](https://github.com/pd93)! :tada: The extension is maintained in a [new repository](https://github.com/go-task/vscode-task) under the `go-task` organization. We're looking to gather feedback from the community so please give it a go and let us know what you think via a [discussion](https://github.com/go-task/vscode-task/discussions), [issue](https://github.com/go-task/vscode-task/issues) or on our [Discord](https://discord.gg/6TY36E39UK)!
> **注意:** 扩展 _需要安装_ v3.23.0 才能正常工作。
- The website was integrated with [Crowdin](https://crowdin.com/project/taskfile) to allow the community to contribute with translations! [Chinese](https://taskfile.dev/zh-Hans/) is the first language available ([#1057](https://github.com/go-task/task/issues/1057), [#1058](https://github.com/go-task/task/issues/1058) by [@misitebao](https://github.com/misitebao)).
- Added task location data to the `--json` flag output ([#1056](https://github.com/go-task/task/issues/1056) by [@pd93](https://github.com/pd93))
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to `Taskfile.yml` ([#1062](https://github.com/go-task/task/issues/1062) by [@misitebao](https://github.com/misitebao)).
- Added new `splitArgs` template function (`{{splitArgs "foo bar 'foo bar
baz'"}}`) to ensure string is split as arguments ([#1040](https://github.com/go-task/task/issues/1040), [#1059](https://github.com/go-task/task/issues/1059) by [@dhanusaputra](https://github.com/dhanusaputra)).
- Fix the value of `{{.CHECKSUM}}` variable in status ([#1076](https://github.com/go-task/task/issues/1076), [#1080](https://github.com/go-task/task/issues/1080) by [@pd93](https://github.com/pd93)).
- Fixed deep copy implementation ([#1072](https://github.com/go-task/task/issues/1072) by [@pd93](https://github.com/pd93))
- Created a tool to assist with releases ([#1086](https://github.com/go-task/task/issues/1086) by [@pd93](https://github.com/pd93)).
## v3.22.0 - 2023-03-10
- Add a brand new `--global` (`-g`) flag that will run a Taskfile from your `$HOME` directory. This is useful to have automation that you can run from anywhere in your system! ([Documentation](https://taskfile.dev/usage/#running-a-global-taskfile), [#1029](https://github.com/go-task/task/pull/1029) by @andreynering).
- Add ability to set `error_only: true` on the `group` output mode. This will instruct Task to only print a command output if it returned with a non-zero exit code ([#664](https://github.com/go-task/task/issues/664), [#1022](https://github.com/go-task/task/pull/1022) by @jaedle).
- Fixed bug where `.task/checksum` file was sometimes not being created when task also declares a `status:` ([#840](https://github.com/go-task/task/issues/840), [#1035](https://github.com/go-task/task/pull/1035) by @harelwa, [#1037](https://github.com/go-task/task/pull/1037) by @pd93).
- Refactored and decoupled fingerprinting from the main Task executor ([#1039](https://github.com/go-task/task/issues/1039) by @pd93).
- Fixed deadlock issue when using `run: once` ([#715](https://github.com/go-task/task/issues/715), [#1025](https://github.com/go-task/task/pull/1025) by @theunrepentantgeek).
- Add a brand new `--global` (`-g`) flag that will run a Taskfile from your `$HOME` directory. This is useful to have automation that you can run from anywhere in your system! ([Documentation](https://taskfile.dev/usage/#running-a-global-taskfile), [#1029](https://github.com/go-task/task/issues/1029) by [@andreynering](https://github.com/andreynering)).
- Add ability to set `error_only: true` on the `group` output mode. This will instruct Task to only print a command output if it returned with a non-zero exit code ([#664](https://github.com/go-task/task/issues/664), [#1022](https://github.com/go-task/task/issues/1022) by [@jaedle](https://github.com/jaedle)).
- Fixed bug where `.task/checksum` file was sometimes not being created when task also declares a `status:` ([#840](https://github.com/go-task/task/issues/840), [#1035](https://github.com/go-task/task/issues/1035) by [@harelwa](https://github.com/harelwa), [#1037](https://github.com/go-task/task/issues/1037) by [@pd93](https://github.com/pd93)).
- Refactored and decoupled fingerprinting from the main Task executor ([#1039](https://github.com/go-task/task/issues/1039) by [@pd93](https://github.com/pd93)).
- Fixed deadlock issue when using `run: once` ([#715](https://github.com/go-task/task/issues/715), [#1025](https://github.com/go-task/task/issues/1025) by [@theunrepentantgeek](https://github.com/theunrepentantgeek)).
## v3.21.0 - 2023-02-22
- Added new `TASK_VERSION` special variable ([#990](https://github.com/go-task/task/issues/990), [#1014](https://github.com/go-task/task/pull/1014) by @ja1code).
- Fixed a bug where tasks were sometimes incorrectly marked as internal ([#1007](https://github.com/go-task/task/pull/1007) by @pd93).
- Update to Go 1.20 (bump minimum version to 1.19) ([#1010](https://github.com/go-task/task/pull/1010) by @pd93)
- Added environment variable `FORCE_COLOR` support to force color output. Usefull for environments without TTY ([#1003](https://github.com/go-task/task/pull/1003) by @automation-stack)
- Added new `TASK_VERSION` special variable ([#990](https://github.com/go-task/task/issues/990), [#1014](https://github.com/go-task/task/issues/1014) by [@ja1code](https://github.com/ja1code)).
- Fixed a bug where tasks were sometimes incorrectly marked as internal ([#1007](https://github.com/go-task/task/issues/1007) by [@pd93](https://github.com/pd93)).
- Update to Go 1.20 (bump minimum version to 1.19) ([#1010](https://github.com/go-task/task/issues/1010) by [@pd93](https://github.com/pd93))
- Added environment variable `FORCE_COLOR` support to force color output. Usefull for environments without TTY ([#1003](https://github.com/go-task/task/issues/1003) by [@automation](https://github.com/automation)-stack)
## v3.20.0 - 2023-01-14
- Improve behavior and performance of status checking when using the `timestamp` mode ([#976](https://github.com/go-task/task/issues/976), [#977](https://github.com/go-task/task/pull/977) by @aminya).
- Performance optimizations were made for large Taskfiles ([#982](https://github.com/go-task/task/pull/982) by @pd93).
- Add ability to configure options for the [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) and [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) builtins ([#908](https://github.com/go-task/task/issues/908), [#929](https://github.com/go-task/task/pull/929) by @pd93, [Documentation](http://taskfile.dev/usage/#set-and-shopt)).
- Add new `platforms:` attribute to `task` and `cmd`, so it's now possible to choose in which platforms that given task or command will be run on. Possible values are operating system (GOOS), architecture (GOARCH) or a combination of the two. Example: `platforms: [linux]`, `platforms: [amd64]` or `platforms: [linux/amd64]`. Other platforms will be skipped ([#978](https://github.com/go-task/task/issues/978), [#980](https://github.com/go-task/task/pull/980) by @leaanthony).
- Improve behavior and performance of status checking when using the `timestamp` mode ([#976](https://github.com/go-task/task/issues/976), [#977](https://github.com/go-task/task/issues/977) by [@aminya](https://github.com/aminya)).
- Performance optimizations were made for large Taskfiles ([#982](https://github.com/go-task/task/issues/982) by [@pd93](https://github.com/pd93)).
- Add ability to configure options for the [`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) and [`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) builtins ([#908](https://github.com/go-task/task/issues/908), [#929](https://github.com/go-task/task/issues/929) by [@pd93](https://github.com/pd93), [Documentation](http://taskfile.dev/usage/#set-and-shopt)).
- Add new `platforms:` attribute to `task` and `cmd`, so it's now possible to choose in which platforms that given task or command will be run on. Possible values are operating system (GOOS), architecture (GOARCH) or a combination of the two. Example: `platforms: [linux]`, `platforms: [amd64]` or `platforms:
[linux/amd64]`. Other platforms will be skipped ([#978](https://github.com/go-task/task/issues/978), [#980](https://github.com/go-task/task/issues/980) by [@leaanthony](https://github.com/leaanthony)).
## v3.19.1 - 2022-12-31
- Small bug fix: closing `Taskfile.yml` once we're done reading it ([#963](https://github.com/go-task/task/issues/963), [#964](https://github.com/go-task/task/pull/964) by @HeCorr).
- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file ([#961](https://github.com/go-task/task/issues/961), [#971](https://github.com/go-task/task/pull/971) by @pd93).
- Fixed a bug where watch intervals set in the Taskfile were not being respected ([#969](https://github.com/go-task/task/pull/969), [#970](https://github.com/go-task/task/pull/970) by @pd93)
- Add `--json` flag (alias `-j`) with the intent to improve support for code editors and add room to other possible integrations. This is basic for now, but we plan to add more info in the near future ([#936](https://github.com/go-task/task/pull/936) by @davidalpert, [#764](https://github.com/go-task/task/issues/764)).
- Small bug fix: closing `Taskfile.yml` once we're done reading it ([#963](https://github.com/go-task/task/issues/963), [#964](https://github.com/go-task/task/issues/964) by [@HeCorr](https://github.com/HeCorr)).
- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file ([#961](https://github.com/go-task/task/issues/961), [#971](https://github.com/go-task/task/issues/971) by [@pd93](https://github.com/pd93)).
- Fixed a bug where watch intervals set in the Taskfile were not being respected ([#969](https://github.com/go-task/task/issues/969), [#970](https://github.com/go-task/task/issues/970) by [@pd93](https://github.com/pd93))
- Add `--json` flag (alias `-j`) with the intent to improve support for code editors and add room to other possible integrations. This is basic for now, but we plan to add more info in the near future ([#936](https://github.com/go-task/task/issues/936) by [@davidalpert](https://github.com/davidalpert), [#764](https://github.com/go-task/task/issues/764)).
## v3.19.0 - 2022-12-05
- Installation via npm now supports [pnpm](https://pnpm.io/) as well ([go-task/go-npm#2](https://github.com/go-task/go-npm/issues/2), [go-task/go-npm#3](https://github.com/go-task/go-npm/pull/3)).
- It's now possible to run Taskfiles from subdirectories! A new `USER_WORKING_DIR` special variable was added to add even more flexibility for monorepos ([#289](https://github.com/go-task/task/issues/289), [#920](https://github.com/go-task/task/pull/920)).
- Add task-level `dotenv` support ([#389](https://github.com/go-task/task/issues/389), [#904](https://github.com/go-task/task/pull/904)).
- It's now possible to use global level variables on `includes` ([#942](https://github.com/go-task/task/issues/942), [#943](https://github.com/go-task/task/pull/943)).
- The website got a brand new [translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by [@DeronW](https://github.com/DeronW). Thanks!
- Installation via npm now supports [pnpm](https://pnpm.io/) as well ([go-task/go-npm\[#2\](https://github.com/go-task/task/issues/2)](https://github.com/go-task/go-npm/issues/2), [go-task/go-npm\[#3\](https://github.com/go-task/task/issues/3)](https://github.com/go-task/go-npm/pull/3)).
- It's now possible to run Taskfiles from subdirectories! A new `USER_WORKING_DIR` special variable was added to add even more flexibility for monorepos ([#289](https://github.com/go-task/task/issues/289), [#920](https://github.com/go-task/task/issues/920)).
- Add task-level `dotenv` support ([#389](https://github.com/go-task/task/issues/389), [#904](https://github.com/go-task/task/issues/904)).
- It's now possible to use global level variables on `includes` ([#942](https://github.com/go-task/task/issues/942), [#943](https://github.com/go-task/task/issues/943)).
- The website got a brand new [translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by [\[@DeronW\](https://github.com/DeronW)](https://github.com/DeronW). Thanks!
## v3.18.0 - 2022-11-12
- Show aliases on `task --list --silent` (`task --ls`). This means that aliases will be completed by the completion scripts ([#919](https://github.com/go-task/task/pull/919)).
- Tasks in the root Taskfile will now be displayed first in `--list`/`--list-all` output ([#806](https://github.com/go-task/task/pull/806), [#890](https://github.com/go-task/task/pull/890)).
- It's now possible to call a `default` task in an included Taskfile by using just the namespace. For example: `docs:default` is now automatically aliased to `docs` ([#661](https://github.com/go-task/task/issues/661), [#815](https://github.com/go-task/task/pull/815)).
- Show aliases on `task --list --silent` (`task --ls`). This means that aliases will be completed by the completion scripts ([#919](https://github.com/go-task/task/issues/919)).
- Tasks in the root Taskfile will now be displayed first in `--list`/`--list-all` output ([#806](https://github.com/go-task/task/issues/806), [#890](https://github.com/go-task/task/issues/890)).
- It's now possible to call a `default` task in an included Taskfile by using just the namespace. For example: `docs:default` is now automatically aliased to `docs` ([#661](https://github.com/go-task/task/issues/661), [#815](https://github.com/go-task/task/issues/815)).
## v3.17.0 - 2022-10-14
- Add a "Did you mean ...?" suggestion when a task does not exits another one with a similar name is found ([#867](https://github.com/go-task/task/issues/867), [#880](https://github.com/go-task/task/pull/880)).
- Now YAML parse errors will print which Taskfile failed to parse ([#885](https://github.com/go-task/task/issues/885), [#887](https://github.com/go-task/task/pull/887)).
- Add ability to set `aliases` for tasks and namespaces ([#268](https://github.com/go-task/task/pull/268), [#340](https://github.com/go-task/task/pull/340), [#879](https://github.com/go-task/task/pull/879)).
- Improvements to Fish shell completion ([#897](https://github.com/go-task/task/pull/897)).
- Added ability to set a different watch interval by setting `interval: '500ms'` or using the `--interval=500ms` flag ([#813](https://github.com/go-task/task/issues/813), [#865](https://github.com/go-task/task/pull/865)).
- Add colored output to `--list`, `--list-all` and `--summary` flags ([#845](https://github.com/go-task/task/pull/845), [#874](https://github.com/go-task/task/pull/874)).
- Fix unexpected behavior where `label:` was being shown instead of the task name on `--list` ([#603](https://github.com/go-task/task/issues/603), [#877](https://github.com/go-task/task/pull/877)).
- Add a "Did you mean ...?" suggestion when a task does not exits another one with a similar name is found ([#867](https://github.com/go-task/task/issues/867), [#880](https://github.com/go-task/task/issues/880)).
- Now YAML parse errors will print which Taskfile failed to parse ([#885](https://github.com/go-task/task/issues/885), [#887](https://github.com/go-task/task/issues/887)).
- Add ability to set `aliases` for tasks and namespaces ([#268](https://github.com/go-task/task/issues/268), [#340](https://github.com/go-task/task/issues/340), [#879](https://github.com/go-task/task/issues/879)).
- Improvements to Fish shell completion ([#897](https://github.com/go-task/task/issues/897)).
- Added ability to set a different watch interval by setting `interval: '500ms'` or using the `--interval=500ms` flag ([#813](https://github.com/go-task/task/issues/813), [#865](https://github.com/go-task/task/issues/865)).
- Add colored output to `--list`, `--list-all` and `--summary` flags ([#845](https://github.com/go-task/task/issues/845), [#874](https://github.com/go-task/task/issues/874)).
- Fix unexpected behavior where `label:` was being shown instead of the task name on `--list` ([#603](https://github.com/go-task/task/issues/603), [#877](https://github.com/go-task/task/issues/877)).
## v3.16.0 - 2022-09-29
- Add `npm` as new installation method: `npm i -g @go-task/cli` ([#870](https://github.com/go-task/task/issues/870), [#871](https://github.com/go-task/task/pull/871), [npm package](https://www.npmjs.com/package/@go-task/cli)).
- Add support to marking tasks and includes as internal, which will hide them from `--list` and `--list-all` ([#818](https://github.com/go-task/task/pull/818)).
- Add `npm` as new installation method: `npm i -g [@go](https://github.com/go)-task/cli` ([#870](https://github.com/go-task/task/issues/870), [#871](https://github.com/go-task/task/issues/871), [npm package](https://www.npmjs.com/package/[@go](https://github.com/go)-task/cli)).
- Add support to marking tasks and includes as internal, which will hide them from `--list` and `--list-all` ([#818](https://github.com/go-task/task/issues/818)).
## v3.15.2 - 2022-09-08
- Fix error when using variable in `env:` introduced in the previous release ([#858](https://github.com/go-task/task/issues/858), [#866](https://github.com/go-task/task/pull/866)).
- Fix handling of `CLI_ARGS` (`--`) in Bash completion ([#863](https://github.com/go-task/task/pull/863)).
- On zsh completion, add ability to replace `--list-all` with `--list` as already possible on the Bash completion ([#861](https://github.com/go-task/task/pull/861)).
- Fix error when using variable in `env:` introduced in the previous release ([#858](https://github.com/go-task/task/issues/858), [#866](https://github.com/go-task/task/issues/866)).
- Fix handling of `CLI_ARGS` (`--`) in Bash completion ([#863](https://github.com/go-task/task/issues/863)).
- On zsh completion, add ability to replace `--list-all` with `--list` as already possible on the Bash completion ([#861](https://github.com/go-task/task/issues/861)).
## v3.15.0 - 2022-09-03
- Add new special variables `ROOT_DIR` and `TASKFILE_DIR`. This was a highly requested feature ([#215](https://github.com/go-task/task/issues/215), [#857](https://github.com/go-task/task/pull/857), [Documentation](https://taskfile.dev/api/#special-variables)).
- Follow symlinks on `sources` ([#826](https://github.com/go-task/task/issues/826), [#831](https://github.com/go-task/task/pull/831)).
- Improvements and fixes to Bash completion ([#835](https://github.com/go-task/task/pull/835), [#844](https://github.com/go-task/task/pull/844)).
- Add new special variables `ROOT_DIR` and `TASKFILE_DIR`. This was a highly requested feature ([#215](https://github.com/go-task/task/issues/215), [#857](https://github.com/go-task/task/issues/857), [Documentation](https://taskfile.dev/api/#special-variables)).
- Follow symlinks on `sources` ([#826](https://github.com/go-task/task/issues/826), [#831](https://github.com/go-task/task/issues/831)).
- Improvements and fixes to Bash completion ([#835](https://github.com/go-task/task/issues/835), [#844](https://github.com/go-task/task/issues/844)).
## v3.14.1 - 2022-08-03
- Always resolve relative include paths relative to the including Taskfile ([#822](https://github.com/go-task/task/issues/822), [#823](https://github.com/go-task/task/pull/823)).
- Fix ZSH and PowerShell completions to consider all tasks instead of just the public ones (those with descriptions) ([#803](https://github.com/go-task/task/pull/803)).
- Always resolve relative include paths relative to the including Taskfile ([#822](https://github.com/go-task/task/issues/822), [#823](https://github.com/go-task/task/issues/823)).
- Fix ZSH and PowerShell completions to consider all tasks instead of just the public ones (those with descriptions) ([#803](https://github.com/go-task/task/issues/803)).
## v3.14.0 - 2022-07-08
- Add ability to override the `.task` directory location with the `TASK_TEMP_DIR` environment variable.
- Allow to override Task colors using environment variables: `TASK_COLOR_RESET`, `TASK_COLOR_BLUE`, `TASK_COLOR_GREEN`, `TASK_COLOR_CYAN`, `TASK_COLOR_YELLOW`, `TASK_COLOR_MAGENTA` and `TASK_COLOR_RED` ([#568](https://github.com/go-task/task/pull/568), [#792](https://github.com/go-task/task/pull/792)).
- Allow to override Task colors using environment variables: `TASK_COLOR_RESET`, `TASK_COLOR_BLUE`, `TASK_COLOR_GREEN`, `TASK_COLOR_CYAN`, `TASK_COLOR_YELLOW`, `TASK_COLOR_MAGENTA` and `TASK_COLOR_RED` ([#568](https://github.com/go-task/task/issues/568), [#792](https://github.com/go-task/task/issues/792)).
- Fixed bug when using the `output: group` mode where STDOUT and STDERR were being print in separated blocks instead of in the right order ([#779](https://github.com/go-task/task/issues/779)).
- Starting on this release, ARM architecture binaries are been released to Snap as well ([#795](https://github.com/go-task/task/issues/795)).
- i386 binaries won't be available anymore on Snap because Ubuntu removed the support for this architecture.
- Upgrade mvdan.cc/sh, which fixes a bug with associative arrays ([#785](https://github.com/go-task/task/issues/785), [mvdan/sh#884](https://github.com/mvdan/sh/issues/884), [mvdan/sh#893](https://github.com/mvdan/sh/pull/893)).
- Upgrade mvdan.cc/sh, which fixes a bug with associative arrays ([#785](https://github.com/go-task/task/issues/785), [mvdan/sh\[#884\](https://github.com/go-task/task/issues/884)](https://github.com/mvdan/sh/issues/884), [mvdan/sh\[#893\](https://github.com/go-task/task/issues/893)](https://github.com/mvdan/sh/pull/893)).
## v3.13.0 - 2022-06-13
- Added `-n` as an alias to `--dry` ([#776](https://github.com/go-task/task/issues/776), [#777](https://github.com/go-task/task/pull/777)).
- Fix behavior of interrupt (SIGINT, SIGTERM) signals. Task will now give time for the processes running to do cleanup work ([#458](https://github.com/go-task/task/issues/458), [#479](https://github.com/go-task/task/pull/479), [#728](https://github.com/go-task/task/issues/728), [#769](https://github.com/go-task/task/pull/769)).
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the command being ran ([#755](https://github.com/go-task/task/pull/755)).
- Added `-n` as an alias to `--dry` ([#776](https://github.com/go-task/task/issues/776), [#777](https://github.com/go-task/task/issues/777)).
- Fix behavior of interrupt (SIGINT, SIGTERM) signals. Task will now give time for the processes running to do cleanup work ([#458](https://github.com/go-task/task/issues/458), [#479](https://github.com/go-task/task/issues/479), [#728](https://github.com/go-task/task/issues/728), [#769](https://github.com/go-task/task/issues/769)).
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the command being ran ([#755](https://github.com/go-task/task/issues/755)).
## v3.12.1 - 2022-05-10
@ -101,99 +117,100 @@ sidebar_position: 7
## v3.12.0 - 2022-03-31
- The `--list` and `--list-all` flags can now be combined with the `--silent` flag to print the task names only, without their description ([#691](https://github.com/go-task/task/pull/691)).
- Added support for multi-level inclusion of Taskfiles. This means that included Taskfiles can also include other Taskfiles. Before this was limited to one level ([#390](https://github.com/go-task/task/issues/390), [#623](https://github.com/go-task/task/discussions/623), [#656](https://github.com/go-task/task/pull/656)).
- Add ability to specify vars when including a Taskfile. [Check out the documentation](https://taskfile.dev/#/usage?id=vars-of-included-taskfiles) for more information. ([#677](https://github.com/go-task/task/pull/677)).
- The `--list` and `--list-all` flags can now be combined with the `--silent` flag to print the task names only, without their description ([#691](https://github.com/go-task/task/issues/691)).
- Added support for multi-level inclusion of Taskfiles. This means that included Taskfiles can also include other Taskfiles. Before this was limited to one level ([#390](https://github.com/go-task/task/issues/390), [#623](https://github.com/go-task/task/issues/623), [#656](https://github.com/go-task/task/issues/656)).
- Add ability to specify vars when including a Taskfile. [Check out the documentation](https://taskfile.dev/#/usage?id=vars-of-included-taskfiles) for more information ([#677](https://github.com/go-task/task/issues/677)).
## v3.11.0 - 2022-02-19
- Task now supports printing begin and end messages when using the `group` output mode, useful for grouping tasks in CI systems. [Check out the documentation](http://taskfile.dev/#/usage?id=output-syntax) for more information ([#647](https://github.com/go-task/task/issues/647), [#651](https://github.com/go-task/task/pull/651)).
- Add `Taskfile.dist.yml` and `Taskfile.dist.yaml` to the supported file name list. [Check out the documentation](https://taskfile.dev/#/usage?id=supported-file-names) for more information ([#498](https://github.com/go-task/task/issues/498), [#666](https://github.com/go-task/task/pull/666)).
- Task now supports printing begin and end messages when using the `group` output mode, useful for grouping tasks in CI systems. [Check out the documentation](http://taskfile.dev/#/usage?id=output-syntax) for more information ([#647](https://github.com/go-task/task/issues/647), [#651](https://github.com/go-task/task/issues/651)).
- Add `Taskfile.dist.yml` and `Taskfile.dist.yaml` to the supported file name list. [Check out the documentation](https://taskfile.dev/#/usage?id=supported-file-names) for more information ([#498](https://github.com/go-task/task/issues/498), [#666](https://github.com/go-task/task/issues/666)).
## v3.10.0 - 2022-01-04
- A new `--list-all` (alias `-a`) flag is now available. It's similar to the exiting `--list` (`-l`) but prints all tasks, even those without a description ([#383](https://github.com/go-task/task/issues/383), [#401](https://github.com/go-task/task/pull/401)).
- It's now possible to schedule cleanup commands to run once a task finishes with the `defer:` keyword ([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer), [#475](https://github.com/go-task/task/issues/475), [#626](https://github.com/go-task/task/pull/626)).
- Remove long deprecated and undocumented `$` variable prefix and `^` command prefix ([#642](https://github.com/go-task/task/issues/642), [#644](https://github.com/go-task/task/issues/644), [#645](https://github.com/go-task/task/pull/645)).
- Add support for `.yaml` extension (as an alternative to `.yml`). This was requested multiple times throughout the years. Enjoy! ([#183](https://github.com/go-task/task/issues/183), [#184](https://github.com/go-task/task/pull/184), [#369](https://github.com/go-task/task/issues/369), [#584](https://github.com/go-task/task/issues/584), [#621](https://github.com/go-task/task/pull/621)).
- Fixed error when computing a variable when the task directory do not exist yet ([#481](https://github.com/go-task/task/issues/481), [#579](https://github.com/go-task/task/pull/579)).
- A new `--list-all` (alias `-a`) flag is now available. It's similar to the exiting `--list` (`-l`) but prints all tasks, even those without a description ([#383](https://github.com/go-task/task/issues/383), [#401](https://github.com/go-task/task/issues/401)).
- It's now possible to schedule cleanup commands to run once a task finishes with the `defer:` keyword ([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer), [#475](https://github.com/go-task/task/issues/475), [#626](https://github.com/go-task/task/issues/626)).
- Remove long deprecated and undocumented `$` variable prefix and `^` command prefix ([#642](https://github.com/go-task/task/issues/642), [#644](https://github.com/go-task/task/issues/644), [#645](https://github.com/go-task/task/issues/645)).
- Add support for `.yaml` extension (as an alternative to `.yml`). This was requested multiple times throughout the years. Enjoy! ([#183](https://github.com/go-task/task/issues/183), [#184](https://github.com/go-task/task/issues/184), [#369](https://github.com/go-task/task/issues/369), [#584](https://github.com/go-task/task/issues/584), [#621](https://github.com/go-task/task/issues/621)).
- Fixed error when computing a variable when the task directory do not exist yet ([#481](https://github.com/go-task/task/issues/481), [#579](https://github.com/go-task/task/issues/579)).
## v3.9.2 - 2021-12-02
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains a fix a for a important regression on Windows ([#619](https://github.com/go-task/task/issues/619), [mvdan/sh#768](https://github.com/mvdan/sh/issues/768), [mvdan/sh#769](https://github.com/mvdan/sh/pull/769)).
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains a fix a for a important regression on Windows ([#619](https://github.com/go-task/task/issues/619), [mvdan/sh\[#768\](https://github.com/go-task/task/issues/768)](https://github.com/mvdan/sh/issues/768), [mvdan/sh\[#769\](https://github.com/go-task/task/issues/769)](https://github.com/mvdan/sh/pull/769)).
## v3.9.1 - 2021-11-28
- Add logging in verbose mode for when a task starts and finishes ([#533](https://github.com/go-task/task/issues/533), [#588](https://github.com/go-task/task/pull/588)).
- Fix an issue with preconditions and context errors ([#597](https://github.com/go-task/task/issues/597), [#598](https://github.com/go-task/task/pull/598)).
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many ([#613](https://github.com/go-task/task/pull/613)).
- Fix nil pointer when `cmd:` was left empty ([#612](https://github.com/go-task/task/issues/612), [#614](https://github.com/go-task/task/pull/614)).
- Add logging in verbose mode for when a task starts and finishes ([#533](https://github.com/go-task/task/issues/533), [#588](https://github.com/go-task/task/issues/588)).
- Fix an issue with preconditions and context errors ([#597](https://github.com/go-task/task/issues/597), [#598](https://github.com/go-task/task/issues/598)).
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many ([#613](https://github.com/go-task/task/issues/613)).
- Fix nil pointer when `cmd:` was left empty ([#612](https://github.com/go-task/task/issues/612), [#614](https://github.com/go-task/task/issues/614)).
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant fixes:
- Fix quote of empty strings in `shellQuote` ([#609](https://github.com/go-task/task/issues/609), [mvdan/sh#763](https://github.com/mvdan/sh/issues/763)).
- Fix issue of wrong environment variable being picked when there's another very similar one ([#586](https://github.com/go-task/task/issues/586), [mvdan/sh#745](https://github.com/mvdan/sh/pull/745)).
- Install shell completions automatically when installing via Homebrew ([#264](https://github.com/go-task/task/issues/264), [#592](https://github.com/go-task/task/pull/592), [go-task/homebrew-tap#2](https://github.com/go-task/homebrew-tap/pull/2)).
- Fix quote of empty strings in `shellQuote` ([#609](https://github.com/go-task/task/issues/609), [mvdan/sh\[#763\](https://github.com/go-task/task/issues/763)](https://github.com/mvdan/sh/issues/763)).
- Fix issue of wrong environment variable being picked when there's another very similar one ([#586](https://github.com/go-task/task/issues/586), [mvdan/sh\[#745\](https://github.com/go-task/task/issues/745)](https://github.com/mvdan/sh/pull/745)).
- Install shell completions automatically when installing via Homebrew ([#264](https://github.com/go-task/task/issues/264), [#592](https://github.com/go-task/task/issues/592), [go-task/homebrew-tap\[#2\](https://github.com/go-task/task/issues/2)](https://github.com/go-task/homebrew-tap/pull/2)).
## v3.9.0 - 2021-10-02
- A new `shellQuote` function was added to the template system (`{{shellQuote "a string"}}`) to ensure a string is safe for use in shell ([mvdan/sh#727](https://github.com/mvdan/sh/pull/727), [mvdan/sh#737](https://github.com/mvdan/sh/pull/737), [Documentation](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote))
- A new `shellQuote` function was added to the template system (`{{shellQuote "a
string"}}`) to ensure a string is safe for use in shell ([mvdan/sh\[#727\](https://github.com/go-task/task/issues/727)](https://github.com/mvdan/sh/pull/727), [mvdan/sh\[#737\](https://github.com/go-task/task/issues/737)](https://github.com/mvdan/sh/pull/737), [Documentation](https://pkg.go.dev/mvdan.cc/sh/v3[@v3](https://github.com/v3).4.0/syntax#Quote))
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with some small fixes and features
- The `read -p` flag is now supported ([#314](https://github.com/go-task/task/issues/314), [mvdan/sh#551](https://github.com/mvdan/sh/issues/551), [mvdan/sh#772](https://github.com/mvdan/sh/pull/722))
- The `pwd -P` and `pwd -L` flags are now supported ([#553](https://github.com/go-task/task/issues/553), [mvdan/sh#724](https://github.com/mvdan/sh/issues/724), [mvdan/sh#728](https://github.com/mvdan/sh/pull/728))
- The `$GID` environment variable is now correctly being set ([#561](https://github.com/go-task/task/issues/561), [mvdan/sh#723](https://github.com/mvdan/sh/pull/723))
- The `read -p` flag is now supported ([#314](https://github.com/go-task/task/issues/314), [mvdan/sh\[#551\](https://github.com/go-task/task/issues/551)](https://github.com/mvdan/sh/issues/551), [mvdan/sh\[#772\](https://github.com/go-task/task/issues/772)](https://github.com/mvdan/sh/pull/722))
- The `pwd -P` and `pwd -L` flags are now supported ([#553](https://github.com/go-task/task/issues/553), [mvdan/sh\[#724\](https://github.com/go-task/task/issues/724)](https://github.com/mvdan/sh/issues/724), [mvdan/sh\[#728\](https://github.com/go-task/task/issues/728)](https://github.com/mvdan/sh/pull/728))
- The `$GID` environment variable is now correctly being set ([#561](https://github.com/go-task/task/issues/561), [mvdan/sh\[#723\](https://github.com/go-task/task/issues/723)](https://github.com/mvdan/sh/pull/723))
## v3.8.0 - 2021-09-26
- Add `interactive: true` setting to improve support for interactive CLI apps ([#217](https://github.com/go-task/task/issues/217), [#563](https://github.com/go-task/task/pull/563)).
- Fix some `nil` errors ([#534](https://github.com/go-task/task/issues/534), [#573](https://github.com/go-task/task/pull/573)).
- Add ability to declare an included Taskfile as optional ([#519](https://github.com/go-task/task/issues/519), [#552](https://github.com/go-task/task/pull/552)).
- Add support for including Taskfiles in the home directory by using `~` ([#539](https://github.com/go-task/task/issues/539), [#557](https://github.com/go-task/task/pull/557)).
- Add `interactive: true` setting to improve support for interactive CLI apps ([#217](https://github.com/go-task/task/issues/217), [#563](https://github.com/go-task/task/issues/563)).
- Fix some `nil` errors ([#534](https://github.com/go-task/task/issues/534), [#573](https://github.com/go-task/task/issues/573)).
- Add ability to declare an included Taskfile as optional ([#519](https://github.com/go-task/task/issues/519), [#552](https://github.com/go-task/task/issues/552)).
- Add support for including Taskfiles in the home directory by using `~` ([#539](https://github.com/go-task/task/issues/539), [#557](https://github.com/go-task/task/issues/557)).
## v3.7.3 - 2021-09-04
- Add official support to Apple M1 ([#564](https://github.com/go-task/task/pull/564), [#567](https://github.com/go-task/task/pull/567)).
- Add official support to Apple M1 ([#564](https://github.com/go-task/task/issues/564), [#567](https://github.com/go-task/task/issues/567)).
- Our [official Homebrew tap](https://github.com/go-task/homebrew-tap) will support more platforms, including Apple M1
## v3.7.0 - 2021-07-31
- Add `run:` setting to control if tasks should run multiple times or not. Available options are `always` (the default), `when_changed` (if a variable modified the task) and `once` (run only once no matter what). This is a long time requested feature. Enjoy! ([#53](https://github.com/go-task/task/issues/53), [#359](https://github.com/go-task/task/pull/359)).
- Add `run:` setting to control if tasks should run multiple times or not. Available options are `always` (the default), `when_changed` (if a variable modified the task) and `once` (run only once no matter what). This is a long time requested feature. Enjoy! ([#53](https://github.com/go-task/task/issues/53), [#359](https://github.com/go-task/task/issues/359)).
## v3.6.0 - 2021-07-10
- Allow using both `sources:` and `status:` in the same task ([#411](https://github.com/go-task/task/issues/411), [#427](https://github.com/go-task/task/issues/427), [#477](https://github.com/go-task/task/pull/477)).
- Allow using both `sources:` and `status:` in the same task ([#411](https://github.com/go-task/task/issues/411), [#427](https://github.com/go-task/task/issues/427), [#477](https://github.com/go-task/task/issues/477)).
- Small optimization and bug fix: don't compute variables if not needed for `dotenv:` ([#517](https://github.com/go-task/task/issues/517)).
## v3.5.0 - 2021-07-04
- Add support for interpolation in `dotenv:` ([#433](https://github.com/go-task/task/discussions/433), [#434](https://github.com/go-task/task/issues/434), [#453](https://github.com/go-task/task/pull/453)).
- Add support for interpolation in `dotenv:` ([#433](https://github.com/go-task/task/issues/433), [#434](https://github.com/go-task/task/issues/434), [#453](https://github.com/go-task/task/issues/453)).
## v3.4.3 - 2021-05-30
- Add support for the `NO_COLOR` environment variable. ([#459](https://github.com/go-task/task/issues/459), [fatih/color#137](https://github.com/fatih/color/pull/137)).
- Fix bug where sources were not considering the right directory in `--watch` mode ([#484](https://github.com/go-task/task/issues/484), [#485](https://github.com/go-task/task/pull/485)).
- Add support for the `NO_COLOR` environment variable. ([#459](https://github.com/go-task/task/issues/459), [fatih/color\[#137\](https://github.com/go-task/task/issues/137)](https://github.com/fatih/color/pull/137)).
- Fix bug where sources were not considering the right directory in `--watch` mode ([#484](https://github.com/go-task/task/issues/484), [#485](https://github.com/go-task/task/issues/485)).
## v3.4.2 - 2021-04-23
- On watch, report which file failed to read ([#472](https://github.com/go-task/task/pull/472)).
- Do not try to catch SIGKILL signal, which are not actually possible ([#476](https://github.com/go-task/task/pull/476)).
- Improve version reporting when building Task from source using Go Modules ([#462](https://github.com/go-task/task/pull/462), [#473](https://github.com/go-task/task/pull/473)).
- On watch, report which file failed to read ([#472](https://github.com/go-task/task/issues/472)).
- Do not try to catch SIGKILL signal, which are not actually possible ([#476](https://github.com/go-task/task/issues/476)).
- Improve version reporting when building Task from source using Go Modules ([#462](https://github.com/go-task/task/issues/462), [#473](https://github.com/go-task/task/issues/473)).
## v3.4.1 - 2021-04-17
- Improve error reporting when parsing YAML: in some situations where you would just see an generic error, you'll now see the actual error with more detail: the YAML line the failed to parse, for example ([#467](https://github.com/go-task/task/issues/467)).
- A JSON Schema was published [here](https://json.schemastore.org/taskfile.json) and is automatically being used by some editors like Visual Studio Code ([#135](https://github.com/go-task/task/issues/135)).
- Print task name before the command in the log output ([#398](https://github.com/go-task/task/pull/398)).
- Print task name before the command in the log output ([#398](https://github.com/go-task/task/issues/398)).
## v3.3.0 - 2021-03-20
- Add support for delegating CLI arguments to commands with `--` and a special `CLI_ARGS` variable ([#327](https://github.com/go-task/task/issues/327)).
- Add a `--concurrency` (alias `-C`) flag, to limit the number of tasks that run concurrently. This is useful for heavy workloads. ([#345](https://github.com/go-task/task/pull/345)).
- Add a `--concurrency` (alias `-C`) flag, to limit the number of tasks that run concurrently. This is useful for heavy workloads. ([#345](https://github.com/go-task/task/issues/345)).
## v3.2.2 - 2021-01-12
- Improve performance of `--list` and `--summary` by skipping running shell variables for these flags ([#332](https://github.com/go-task/task/issues/332)).
- Fixed a bug where an environment in a Taskfile was not always overridable by the system environment ([#425](https://github.com/go-task/task/issues/425)).
- Fixed environment from .env files not being available as variables ([#379](https://github.com/go-task/task/issues/379)).
- The install script is now working for ARM platforms ([#428](https://github.com/go-task/task/pull/428)).
- The install script is now working for ARM platforms ([#428](https://github.com/go-task/task/issues/428)).
## v3.2.1 - 2021-01-09
@ -204,7 +221,7 @@ sidebar_position: 7
- Fix the `.task` directory being created in the task directory instead of the Taskfile directory ([#247](https://github.com/go-task/task/issues/247)).
- Fix a bug where dynamic variables (those declared with `sh:`) were not running in the task directory when the task has a custom dir or it was in an included Taskfile ([#384](https://github.com/go-task/task/issues/384)).
- The watch feature (via the `--watch` flag) got a few different bug fixes and should be more stable now ([#423](https://github.com/go-task/task/pull/423), [#365](https://github.com/go-task/task/issues/365)).
- The watch feature (via the `--watch` flag) got a few different bug fixes and should be more stable now ([#423](https://github.com/go-task/task/issues/423), [#365](https://github.com/go-task/task/issues/365)).
## v3.1.0 - 2021-01-03
@ -215,40 +232,40 @@ sidebar_position: 7
## v3.0.1 - 2020-12-26
- Allow use as a library by moving the required packages out of the `internal` directory ([#358](https://github.com/go-task/task/pull/358)).
- Do not error if a specified dotenv file does not exist ([#378](https://github.com/go-task/task/issues/378), [#385](https://github.com/go-task/task/pull/385)).
- Fix panic when you have empty tasks in your Taskfile ([#338](https://github.com/go-task/task/issues/338), [#362](https://github.com/go-task/task/pull/362)).
- Allow use as a library by moving the required packages out of the `internal` directory ([#358](https://github.com/go-task/task/issues/358)).
- Do not error if a specified dotenv file does not exist ([#378](https://github.com/go-task/task/issues/378), [#385](https://github.com/go-task/task/issues/385)).
- Fix panic when you have empty tasks in your Taskfile ([#338](https://github.com/go-task/task/issues/338), [#362](https://github.com/go-task/task/issues/362)).
## v3.0.0 - 2020-08-16
- On `v3`, all CLI variables will be considered global variables ([#336](https://github.com/go-task/task/issues/336), [#341](https://github.com/go-task/task/pull/341))
- Add support to `.env` like files ([#324](https://github.com/go-task/task/issues/324), [#356](https://github.com/go-task/task/pull/356)).
- Add `label:` to task so you can override the task name in the logs ([#321](https://github.com/go-task/task/issues/321]), [#337](https://github.com/go-task/task/pull/337)).
- Refactor how variables work on version 3 ([#311](https://github.com/go-task/task/pull/311)).
- On `v3`, all CLI variables will be considered global variables ([#336](https://github.com/go-task/task/issues/336), [#341](https://github.com/go-task/task/issues/341))
- Add support to `.env` like files ([#324](https://github.com/go-task/task/issues/324), [#356](https://github.com/go-task/task/issues/356)).
- Add `label:` to task so you can override the task name in the logs ([\[#321\](https://github.com/go-task/task/issues/321)](https://github.com/go-task/task/issues/321]), [#337](https://github.com/go-task/task/issues/337)).
- Refactor how variables work on version 3 ([#311](https://github.com/go-task/task/issues/311)).
- Disallow `expansions` on v3 since it has no effect.
- `Taskvars.yml` is not automatically included anymore.
- `Taskfile_{{OS}}.yml` is not automatically included anymore.
- Allow interpolation on `includes`, so you can manually include a Taskfile based on operation system, for example.
- Expose `.TASK` variable in templates with the task name ([#252](https://github.com/go-task/task/issues/252)).
- Implement short task syntax ([#194](https://github.com/go-task/task/issues/194), [#240](https://github.com/go-task/task/pull/240)).
- Implement short task syntax ([#194](https://github.com/go-task/task/issues/194), [#240](https://github.com/go-task/task/issues/240)).
- Added option to make included Taskfile run commands on its own directory ([#260](https://github.com/go-task/task/issues/260), [#144](https://github.com/go-task/task/issues/144))
- Taskfiles in version 1 are not supported anymore ([#237](https://github.com/go-task/task/pull/237)).
- Taskfiles in version 1 are not supported anymore ([#237](https://github.com/go-task/task/issues/237)).
- Added global `method:` option. With this option, you can set a default method to all tasks in a Taskfile ([#246](https://github.com/go-task/task/issues/246)).
- Changed default method from `timestamp` to `checksum` ([#246](https://github.com/go-task/task/issues/246)).
- New magic variables are now available when using `status:`: `.TIMESTAMP` which contains the greatest modification date from the files listed in `sources:`, and `.CHECKSUM`, which contains a checksum of all files listed in `status:`. This is useful for manual checking when using external, or even remote, artifacts when using `status:` ([#216](https://github.com/go-task/task/pull/216)).
- We're now using [slim-sprig](https://github.com/go-task/slim-sprig) instead of [sprig](https://github.com/Masterminds/sprig), which allowed a file size reduction of about 22% ([#219](https://github.com/go-task/task/pull/219)).
- We now use some colors on Task output to better distinguish message types - commands are green, errors are red, etc ([#207](https://github.com/go-task/task/pull/207)).
- New magic variables are now available when using `status:`: `.TIMESTAMP` which contains the greatest modification date from the files listed in `sources:`, and `.CHECKSUM`, which contains a checksum of all files listed in `status:`. This is useful for manual checking when using external, or even remote, artifacts when using `status:` ([#216](https://github.com/go-task/task/issues/216)).
- We're now using [slim-sprig](https://github.com/go-task/slim-sprig) instead of [sprig](https://github.com/Masterminds/sprig), which allowed a file size reduction of about 22% ([#219](https://github.com/go-task/task/issues/219)).
- We now use some colors on Task output to better distinguish message types - commands are green, errors are red, etc ([#207](https://github.com/go-task/task/issues/207)).
## v2.8.1 - 2020-05-20
- Fix error code for the `--help` flag ([#300](https://github.com/go-task/task/issues/300), [#330](https://github.com/go-task/task/pull/330)).
- Print version to stdout instead of stderr ([#299](https://github.com/go-task/task/issues/299), [#329](https://github.com/go-task/task/pull/329)).
- Supress `context` errors when using the `--watch` flag ([#313](https://github.com/go-task/task/issues/313), [#317](https://github.com/go-task/task/pull/317)).
- Support templating on description ([#276](https://github.com/go-task/task/issues/276), [#283](https://github.com/go-task/task/pull/283)).
- Fix error code for the `--help` flag ([#300](https://github.com/go-task/task/issues/300), [#330](https://github.com/go-task/task/issues/330)).
- Print version to stdout instead of stderr ([#299](https://github.com/go-task/task/issues/299), [#329](https://github.com/go-task/task/issues/329)).
- Supress `context` errors when using the `--watch` flag ([#313](https://github.com/go-task/task/issues/313), [#317](https://github.com/go-task/task/issues/317)).
- Support templating on description ([#276](https://github.com/go-task/task/issues/276), [#283](https://github.com/go-task/task/issues/283)).
## v2.8.0 - 2019-12-07
- Add `--parallel` flag (alias `-p`) to run tasks given by the command line in parallel ([#266](https://github.com/go-task/task/pull/266)).
- Add `--parallel` flag (alias `-p`) to run tasks given by the command line in parallel ([#266](https://github.com/go-task/task/issues/266)).
- Fixed bug where calling the `task` CLI only informing global vars would not execute the `default` task.
- Add hability to silent all tasks by adding `silent: true` a the root of the Taskfile.
@ -258,81 +275,81 @@ sidebar_position: 7
## v2.7.0 - 2019-09-22
- Fixed panic bug when assigning a global variable ([#229](https://github.com/go-task/task/issues/229), [#243](https://github.com/go-task/task/issues/234)).
- A task with `method: checksum` will now re-run if generated files are deleted ([#228](https://github.com/go-task/task/pull/228), [#238](https://github.com/go-task/task/issues/238)).
- Fixed panic bug when assigning a global variable ([#229](https://github.com/go-task/task/issues/229), [#243](https://github.com/go-task/task/issues/243)).
- A task with `method: checksum` will now re-run if generated files are deleted ([#228](https://github.com/go-task/task/issues/228), [#238](https://github.com/go-task/task/issues/238)).
## v2.6.0 - 2019-07-21
- Fixed some bugs regarding minor version checks on `version:`.
- Add `preconditions:` to task ([#205](https://github.com/go-task/task/pull/205)).
- Create directory informed on `dir:` if it doesn't exist ([#209](https://github.com/go-task/task/issues/209), [#211](https://github.com/go-task/task/pull/211)).
- We now have a `--taskfile` flag (alias `-t`), which can be used to run another Taskfile (other than the default `Taskfile.yml`) ([#221](https://github.com/go-task/task/pull/221)).
- It's now possible to install Task using Homebrew on Linux ([go-task/homebrew-tap#1](https://github.com/go-task/homebrew-tap/pull/1)).
- Add `preconditions:` to task ([#205](https://github.com/go-task/task/issues/205)).
- Create directory informed on `dir:` if it doesn't exist ([#209](https://github.com/go-task/task/issues/209), [#211](https://github.com/go-task/task/issues/211)).
- We now have a `--taskfile` flag (alias `-t`), which can be used to run another Taskfile (other than the default `Taskfile.yml`) ([#221](https://github.com/go-task/task/issues/221)).
- It's now possible to install Task using Homebrew on Linux ([go-task/homebrew-tap\[#1\](https://github.com/go-task/task/issues/1)](https://github.com/go-task/homebrew-tap/pull/1)).
## v2.5.2 - 2019-05-11
- Reverted YAML upgrade due issues with CRLF on Windows ([#201](https://github.com/go-task/task/issues/201), [go-yaml/yaml#450](https://github.com/go-yaml/yaml/issues/450)).
- Reverted YAML upgrade due issues with CRLF on Windows ([#201](https://github.com/go-task/task/issues/201), [go-yaml/yaml\[#450\](https://github.com/go-task/task/issues/450)](https://github.com/go-yaml/yaml/issues/450)).
- Allow setting global variables through the CLI ([#192](https://github.com/go-task/task/issues/192)).
## 2.5.1 - 2019-04-27
- Fixed some issues with interactive command line tools, where sometimes the output were not being shown, and similar issues ([#114](https://github.com/go-task/task/issues/114), [#190](https://github.com/go-task/task/issues/190), [#200](https://github.com/go-task/task/pull/200)).
- Fixed some issues with interactive command line tools, where sometimes the output were not being shown, and similar issues ([#114](https://github.com/go-task/task/issues/114), [#190](https://github.com/go-task/task/issues/190), [#200](https://github.com/go-task/task/issues/200)).
- Upgraded [go-yaml/yaml](https://github.com/go-yaml/yaml) from v2 to v3.
## v2.5.0 - 2019-03-16
- We moved from the taskfile.org domain to the new fancy taskfile.dev domain. While stuff is being redirected, we strongly recommend to everyone that use [this install script](https://taskfile.dev/#/installation?id=install-script) to use the new taskfile.dev domain on scripts from now on.
- Fixed to the ZSH completion ([#182](https://github.com/go-task/task/pull/182)).
- Add [`--summary` flag along with `summary:` task attribute](https://taskfile.org/#/usage?id=display-summary-of-task) ([#180](https://github.com/go-task/task/pull/180)).
- Fixed to the ZSH completion ([#182](https://github.com/go-task/task/issues/182)).
- Add [`--summary` flag along with `summary:` task attribute](https://taskfile.org/#/usage?id=display-summary-of-task) ([#180](https://github.com/go-task/task/issues/180)).
## v2.4.0 - 2019-02-21
- Allow calling a task of the root Taskfile from an included Taskfile by prefixing it with `:` ([#161](https://github.com/go-task/task/issues/161), [#172](https://github.com/go-task/task/issues/172)),
- Add flag to override the `output` option ([#173](https://github.com/go-task/task/pull/173));
- Fix bug where Task was persisting the new checksum on the disk when the Dry Mode is enabled ([#166](https://github.com/go-task/task/issues/166));
- Fix file timestamp issue when the file name has spaces ([#176](https://github.com/go-task/task/issues/176));
- Mitigating path expanding issues on Windows ([#170](https://github.com/go-task/task/pull/170)).
- Allow calling a task of the root Taskfile from an included Taskfile by prefixing it with `:` ([#161](https://github.com/go-task/task/issues/161), [#172](https://github.com/go-task/task/issues/172)).
- Add flag to override the `output` option ([#173](https://github.com/go-task/task/issues/173)).
- Fix bug where Task was persisting the new checksum on the disk when the Dry Mode is enabled ([#166](https://github.com/go-task/task/issues/166)).
- Fix file timestamp issue when the file name has spaces ([#176](https://github.com/go-task/task/issues/176)).
- Mitigating path expanding issues on Windows ([#170](https://github.com/go-task/task/issues/170)).
## v2.3.0 - 2019-01-02
- On Windows, Task can now be installed using [Scoop](https://scoop.sh/) ([#152](https://github.com/go-task/task/pull/152));
- Fixed issue with file/directory globing ([#153](https://github.com/go-task/task/issues/153));
- Added ability to globally set environment variables ( [#138](https://github.com/go-task/task/pull/138), [#159](https://github.com/go-task/task/pull/159) ).
- On Windows, Task can now be installed using [Scoop](https://scoop.sh/) ([#152](https://github.com/go-task/task/issues/152)).
- Fixed issue with file/directory globing ([#153](https://github.com/go-task/task/issues/153)).
- Added ability to globally set environment variables ([#138](https://github.com/go-task/task/issues/138), [#159](https://github.com/go-task/task/issues/159)).
## v2.2.1 - 2018-12-09
- This repository now uses Go Modules (#143). We'll still keep the `vendor` directory in sync for some time, though;
- Fixing a bug when the Taskfile has no tasks but includes another Taskfile (#150);
- Fix a bug when calling another task or a dependency in an included Taskfile (#151).
- This repository now uses Go Modules ([#143](https://github.com/go-task/task/issues/143)). We'll still keep the `vendor` directory in sync for some time, though;
- Fixing a bug when the Taskfile has no tasks but includes another Taskfile ([#150](https://github.com/go-task/task/issues/150));
- Fix a bug when calling another task or a dependency in an included Taskfile ([#151](https://github.com/go-task/task/issues/151)).
## v2.2.0 - 2018-10-25
- Added support for [including other Taskfiles](https://taskfile.org/#/usage?id=including-other-taskfiles) (#98)
- This should be considered experimental. For now, only including local files is supported, but support for including remote Taskfiles is being discussed. If you have any feedback, please comment on #98.
- Added support for [including other Taskfiles](https://taskfile.org/#/usage?id=including-other-taskfiles) ([#98](https://github.com/go-task/task/issues/98))
- This should be considered experimental. For now, only including local files is supported, but support for including remote Taskfiles is being discussed. If you have any feedback, please comment on [#98](https://github.com/go-task/task/issues/98).
- Task now have a dedicated documentation site: https://taskfile.org
- Thanks to [Docsify](https://docsify.js.org/) for making this pretty easy. To check the source code, just take a look at the [docs](https://github.com/go-task/task/tree/master/docs) directory of this repository. Contributions to the documentation is really appreciated.
## v2.1.1 - 2018-09-17
- Fix suggestion to use `task --init` not being shown anymore (when a `Taskfile.yml` is not found)
- Fix error when using checksum method and no file exists for a source glob (#131)
- Fix signal handling when the `--watch` flag is given (#132)
- Fix error when using checksum method and no file exists for a source glob ([#131](https://github.com/go-task/task/issues/131))
- Fix signal handling when the `--watch` flag is given ([#132](https://github.com/go-task/task/issues/132))
## v2.1.0 - 2018-08-19
- Add a `ignore_error` option to task and command (#123)
- Add a dry run mode (`--dry` flag) (#126)
- Add a `ignore_error` option to task and command ([#123](https://github.com/go-task/task/issues/123))
- Add a dry run mode (`--dry` flag) ([#126](https://github.com/go-task/task/issues/126))
## v2.0.3 - 2018-06-24
- Expand environment variables on "dir", "sources" and "generates" (#116)
- Fix YAML merging syntax (#112)
- Add ZSH completion (#111)
- Expand environment variables on "dir", "sources" and "generates" ([#116](https://github.com/go-task/task/issues/116))
- Fix YAML merging syntax ([#112](https://github.com/go-task/task/issues/112))
- Add ZSH completion ([#111](https://github.com/go-task/task/issues/111))
- Implement new `output` option. Please check out the [documentation](https://github.com/go-task/task#output-syntax)
## v2.0.2 - 2018-05-01
- Fix merging of YAML anchors (#112)
- Fix merging of YAML anchors ([#112](https://github.com/go-task/task/issues/112))
## v2.0.1 - 2018-03-11
@ -344,36 +361,36 @@ Version 2.0.0 is here, with a new Taskfile format.
Please, make sure to read the [Taskfile versions](https://github.com/go-task/task/blob/master/TASKFILE_VERSIONS.md) document, since it describes in depth what changed for this version.
* New Taskfile version 2 (https://github.com/go-task/task/issues/77)
* Possibility to have global variables in the `Taskfile.yml` instead of `Taskvars.yml` (https://github.com/go-task/task/issues/66)
* Small improvements and fixes
- New Taskfile version 2 ([#77](https://github.com/go-task/task/issues/77))
- Possibility to have global variables in the `Taskfile.yml` instead of `Taskvars.yml` ([#66](https://github.com/go-task/task/issues/66))
- Small improvements and fixes
## v1.4.4 - 2017-11-19
- Handle SIGINT and SIGTERM (#75);
- Handle SIGINT and SIGTERM ([#75](https://github.com/go-task/task/issues/75));
- List: print message with there's no task with description;
- Expand home dir ("~" symbol) on paths (#74);
- Expand home dir ("~" symbol) on paths ([#74](https://github.com/go-task/task/issues/74));
- Add Snap as an installation method;
- Move examples to its own repo;
- Watch: also walk on tasks called on on "cmds", and not only on "deps";
- Print logs to stderr instead of stdout (#68);
- Print logs to stderr instead of stdout ([#68](https://github.com/go-task/task/issues/68));
- Remove deprecated `set` keyword;
- Add checksum based status check, alternative to timestamp based.
## v1.4.3 - 2017-09-07
- Allow assigning variables to tasks at run time via CLI (#33)
- Added suport for multiline variables from sh (#64)
- Fixes env: remove square braces and evaluate shell (#62)
- Allow assigning variables to tasks at run time via CLI ([#33](https://github.com/go-task/task/issues/33))
- Added suport for multiline variables from sh ([#64](https://github.com/go-task/task/issues/64))
- Fixes env: remove square braces and evaluate shell ([#62](https://github.com/go-task/task/issues/62))
- Watch: change watch library and few fixes and improvements
- When use watching, cancel and restart long running process on file change (#59 and #60)
- When use watching, cancel and restart long running process on file change ([#59](https://github.com/go-task/task/issues/59) and [#60](https://github.com/go-task/task/issues/60))
## v1.4.2 - 2017-07-30
- Flag to set directory of execution
- Always echo command if is verbose mode
- Add silent mode to disable echoing of commands
- Fixes and improvements of variables (#56)
- Fixes and improvements of variables ([#56](https://github.com/go-task/task/issues/56))
## v1.4.1 - 2017-07-15
@ -381,28 +398,28 @@ Please, make sure to read the [Taskfile versions](https://github.com/go-task/tas
- `VAR: {sh: echo Hello}` instead of `VAR: $echo Hello`
- Add `--list` (or `-l`) flag to print existing tasks
- OS specific Taskvars file (e.g. `Taskvars_windows.yml`, `Taskvars_linux.yml`, etc)
- Consider task up-to-date on equal timestamps (#49)
- Allow absolute path in generates section (#48)
- Bugfix: allow templating when calling deps (#42)
- Consider task up-to-date on equal timestamps ([#49](https://github.com/go-task/task/issues/49))
- Allow absolute path in generates section ([#48](https://github.com/go-task/task/issues/48))
- Bugfix: allow templating when calling deps ([#42](https://github.com/go-task/task/issues/42))
- Fix panic for invalid task in cyclic dep detection
- Better error output for dynamic variables in Taskvars.yml (#41)
- Better error output for dynamic variables in Taskvars.yml ([#41](https://github.com/go-task/task/issues/41))
- Allow template evaluation in parameters
## v1.4.0 - 2017-07-06
- Cache dynamic variables
- Add verbose mode (`-v` flag)
- Support to task parameters (overriding vars) (#31) (#32)
- Print command, also when "set:" is specified (#35)
- Improve task command help text (#35)
- Support to task parameters (overriding vars) ([#31](https://github.com/go-task/task/issues/31)) ([#32](https://github.com/go-task/task/issues/32))
- Print command, also when "set:" is specified ([#35](https://github.com/go-task/task/issues/35))
- Improve task command help text ([#35](https://github.com/go-task/task/issues/35))
## v1.3.1 - 2017-06-14
- Fix glob not working on commands (#28)
- Fix glob not working on commands ([#28](https://github.com/go-task/task/issues/28))
- Add ExeExt template function
- Add `--init` flag to create a new Taskfile
- Add status option to prevent task from running (#27)
- Allow interpolation on `generates` and `sources` attributes (#26)
- Add status option to prevent task from running ([#27](https://github.com/go-task/task/issues/27))
- Allow interpolation on `generates` and `sources` attributes ([#26](https://github.com/go-task/task/issues/26))
## v1.3.0 - 2017-04-24
@ -420,18 +437,18 @@ Please, make sure to read the [Taskfile versions](https://github.com/go-task/tas
- Watch a task (experimental)
- Possibility to call another task
- Fix "=" not being reconized in variables/environment variables
- Tasks can now have a description, and help will print them (#10)
- Tasks can now have a description, and help will print them ([#10](https://github.com/go-task/task/issues/10))
- Task dependencies now run concurrently
- Support for a default task (#16)
- Support for a default task ([#16](https://github.com/go-task/task/issues/16))
## v1.1.0 - 2017-03-08
- Support for YAML, TOML and JSON (#1)
- Support running command in another directory (#4)
- Support for YAML, TOML and JSON ([#1](https://github.com/go-task/task/issues/1))
- Support running command in another directory ([#4](https://github.com/go-task/task/issues/4))
- `--force` or `-f` flag to force execution of task even when it's up-to-date
- Detection of cyclic dependencies (#5)
- Support for variables (#6, #9, #14)
- Operation System specific commands and variables (#13)
- Detection of cyclic dependencies ([#5](https://github.com/go-task/task/issues/5))
- Support for variables ([#6](https://github.com/go-task/task/issues/6), [#9](https://github.com/go-task/task/issues/9), [#14](https://github.com/go-task/task/issues/14))
- Operation System specific commands and variables ([#13](https://github.com/go-task/task/issues/13))
## v1.0.0 - 2017-02-28

View File

@ -35,14 +35,14 @@ tasks:
- [易于安装](installation.md):只需要下载一个二进制文件,添加到 `$PATH` 即可! 或者,您也可以根据需要使用 [Homebrew](https://brew.sh/)、[Snapcraft](https://snapcraft.io/) 或 [Scoop](https://scoop.sh/) 进行安装。
- 可以在 CI 中使用:只要添加 [这个命令](installation.md#安装脚本) 到 CI 安装脚本中,然后就可以把 Task 当做 CI 的一个功能来使用了。
- 真正的跨平台:虽然大多数构建工具只能在 Linux 或 macOS 上运行良好,但由于 [这个用于 Go 的 shell 解释器](https://github.com/mvdan/sh),Task 也支持 Windows。
- 非常适合代码生成:如果给定的一组文件自上次运行以来没有更改(基于其时间戳或内容),您可以轻松地阻止任务运行。
- 非常适合代码生成:如果给定的一组文件自上次运行以来没有更改(基于其时间戳或内容),您可以轻松地 [阻止任务运行](/usage#减少不必要的工作)
## 金牌赞助商
<div class="gold-sponsors">
| [Appwrite][appwrite] |
| - |
| [![Appwrite](/img/appwrite.svg)][appwrite] |
| [Appwrite](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
| ---------------------------------------------------------------------------------------------------------------------------- |
| [![Appwrite](/img/appwrite.svg)](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
</div>

View File

@ -22,15 +22,15 @@ tasks:
- esbuild --bundle --minify css/index.css > public/bundle.css
```
运行任务就这样简单:
运行 task 就这样简单:
```bash
task assets build
```
Task uses [mvdan.cc/sh](https://mvdan.cc/sh/), a native Go sh interpreter. So you can write sh/bash commands, and it will work even on Windows, where `sh` or `bash` are usually not available. Just remember any executable called must be available by the OS or in PATH.
Task 使用 [mvdan.cc/sh](https://mvdan.cc/sh/),一个原生的 Go sh 解释器。 因此,您可以编写 sh/bash 命令,它甚至可以在 Windows 上运行,而 `sh``bash` 通常不可用。 请记住,任何被调用的可执行文件都必须在操作系统或 PATH 中可用。
If you omit a task name, "default" will be assumed.
如果不传 task 的名字,默认会调用 "default"。
## 支持的文件名称
@ -41,13 +41,13 @@ Task 会按以下顺序查找配置文件:
- Taskfile.dist.yml
- Taskfile.dist.yaml
The intention of having the `.dist` variants is to allow projects to have one committed version (`.dist`) while still allowing individual users to override the Taskfile by adding an additional `Taskfile.yml` (which would be on `.gitignore`).
使用 `.dist` 变体的目的是允许项目有一个提交版本 (`.dist`),同时仍然允许个人用户通过添加额外的 `Taskfile.yml`(将在 `.gitignore` 上)来覆盖 Taskfile。
### 从子目录运行 Taskfile
If a Taskfile cannot be found in the current working directory, it will walk up the file tree until it finds one (similar to how `git` works). When running Task from a subdirectory like this, it will behave as if you ran it from the directory containing the Taskfile.
如果在当前工作目录中找不到 Taskfile,它将沿着文件树向上查找,直到找到一个(类似于 `git` 的工作方式)。 当从这样的子目录运行 Task 时,它的行为就像从包含 Taskfile 的目录运行它一样。
You can use this functionality along with the special `{{.USER_WORKING_DIR}}` variable to create some very useful reusable tasks. For example, if you have a monorepo with directories for each microservice, you can `cd` into a microservice directory and run a task command to bring it up without having to create multiple tasks or Taskfiles with identical content. For example:
您可以将此功能与特殊的 `{{.USER_WORKING_DIR}}` 变量一起使用来创建一些非常有用的可重用 task。 例如,如果你有一个包含每个微服务目录的 monorepo,你可以 `cd` 进入一个微服务目录并运行一个 task 命令来启动它,而不必创建多个 task 或具有相同内容的 Taskfile。 例如:
```yaml
version: '3'
@ -61,13 +61,13 @@ tasks:
- docker-compose up -d
```
In this example, we can run `cd <service>` and `task up` and as long as the `<service>` directory contains a `docker-compose.yml`, the Docker composition will be brought up.
在此示例中,我们可以运行 `cd <service>``task up`,只要 `<service>` 目录包含 `docker-compose.yml`,就会启动 Docker Compose。
### 运行全局 Taskfile
If you call Task with the `--global` (alias `-g`) flag, it will look for your home directory instead of your working directory. In short, Task will look for a Taskfile on either `$HOME/Taskfile.yml` or `$HOME/Taskfile.yaml` paths.
This is useful to have automation that you can run from anywhere in your system!
这对于您可以在系统的任何地方运行的自动化很有用!
:::info
@ -110,7 +110,7 @@ tasks:
GREETING: Hey, there!
```
Additionally, you can set global environment variables that will be available to all tasks:
此外,您可以设置可用于所有 task 的全局环境变量:
```yaml
version: '3'
@ -127,14 +127,14 @@ tasks:
:::info
`env` supports expansion and retrieving output from a shell command just like variables, as you can see in the [Variables](#variables) section.
`env` 支持扩展和检索 shell 命令的输出,就像变量一样,如您在 [变量](#变量) 部分中看到的那样。
:::
### .env 文件
You can also ask Task to include `.env` like files by using the `dotenv:` setting:
您还可以使用 `dotenv:` 设置要求 tasks 包含 `.env` 之类的文件
```bash title=".env"
KEYNAME=VALUE
@ -158,7 +158,7 @@ tasks:
- echo "Using $KEYNAME and endpoint $ENDPOINT"
```
也可以在任务级指定 .env 文件:
也可以在 task 级别指定 .env 文件:
```yaml
version: '3'
@ -173,7 +173,7 @@ tasks:
- echo "Using $KEYNAME and endpoint $ENDPOINT"
```
Environment variables specified explicitly at the task-level will override variables defined in dotfiles:
在 task 级别明确指定的环境变量将覆盖点文件中定义的变量:
```yaml
version: '3'
@ -200,7 +200,7 @@ tasks:
## 包含其他 Taskfile
If you want to share tasks between different projects (Taskfiles), you can use the importing mechanism to include other Taskfiles using the `includes` keyword:
如果要在不同项目(Taskfile)之间共享任务,可以使用导入机制使用 `includes` 关键字包含其他任务文件:
```yaml
version: '3'
@ -212,7 +212,7 @@ includes:
The tasks described in the given Taskfiles will be available with the informed namespace. So, you'd call `task docs:serve` to run the `serve` task from `documentation/Taskfile.yml` or `task docker:build` to run the `build` task from the `DockerTasks.yml` file.
Relative paths are resolved relative to the directory containing the including Taskfile.
相对路径是相对于包含包含 Taskfile 的目录解析的。
### 操作系统特定 Taskfile
@ -227,7 +227,7 @@ includes:
### 包含 Taskfile 的目录
By default, included Taskfile's tasks are run in the current directory, even if the Taskfile is in another directory, but you can force its tasks to run in another directory by using this alternative syntax:
默认情况下,包含的 Taskfile 的 task 在当前目录中运行,即使 Taskfile 在另一个目录中,但您可以使用以下替代语法强制其 task 在另一个目录中运行:
```yaml
version: '3'
@ -241,14 +241,14 @@ includes:
:::info
The included Taskfiles must be using the same schema version as the main Taskfile uses.
包含的 Taskfile 必须使用与主 Taskfile 使用的相同规则版本。
:::
### 可选 includes
Includes marked as optional will allow Task to continue execution as normal if the included file is missing.
如果包含文件丢失,标记为可选的包含将允许 task 继续正常执行。
```yaml
version: '3'
@ -279,7 +279,7 @@ includes:
### 包含的 Taskfile 的变量
You can also specify variables when including a Taskfile. This may be useful for having reusable Taskfile that can be tweaked or even included more than once:
您还可以在包含 Taskfile 时指定变量。 这对于拥有可以调整甚至多次包含的可重用 Taskfile 可能很有用:
```yaml
version: '3'
@ -352,7 +352,7 @@ tasks:
- caddy
```
If the directory does not exist, `task` creates it.
如果该目录不存在,`task` 会创建它。
## Task 依赖
@ -376,7 +376,7 @@ tasks:
In the above example, `assets` will always run right before `build` if you run `task build`.
A task can have only dependencies and no commands to group tasks together:
一个任务只能有依赖关系,没有命令来将任务组合在一起:
```yaml
version: '3'
@ -394,7 +394,7 @@ tasks:
- esbuild --bundle --minify css/index.css > public/bundle.css
```
If there is more than one dependency, they always run in parallel for better performance.
如果有多个依赖项,它们总是并行运行以获得更好的性能。
:::tip
@ -404,7 +404,7 @@ You can also make the tasks given by the command line run in parallel by using t
:::
If you want to pass information to dependencies, you can do that the same manner as you would to [call another task](#calling-another-task):
如果你想将信息传递给依赖项,你可以像 [调用另一个任务](#调用另一个-task) 一样以相同的方式进行:
```yaml
version: '3'
@ -493,7 +493,7 @@ tasks:
## 调用另一个 task
When a task has many dependencies, they are executed concurrently. This will often result in a faster build pipeline. However, in some situations, you may need to call other tasks serially. In this case, use the following syntax:
当一个 task 有很多依赖时,它们是并发执行的。 这通常会导致更快的构建管道。 但是,在某些情况下,您可能需要串行调用其他 task。 在这种情况下,请使用以下语法:
```yaml
version: '3'
@ -514,7 +514,7 @@ tasks:
- echo "Another task"
```
Overriding variables in the called task is as simple as informing `vars` attribute:
在被调用 task 中覆盖变量就像通知 `vars` 属性一样简单:
```yaml
version: '3'
@ -532,7 +532,7 @@ tasks:
vars: {RECIPIENT: "Cruel World"}
```
The above syntax is also supported in `deps`.
`deps` 也支持上述语法。
:::tip
@ -546,7 +546,7 @@ NOTE: If you want to call a task declared in the root Taskfile from within an [i
### 通过指纹识别本地生成的文件及其来源
If a task generates something, you can inform Task the source and generated files, so Task will prevent running them if not necessary.
如果一个 task 生成了一些东西,你可以通知 task 源和生成的文件,这样 task 就会在不需要的时候阻止运行它们。
```yaml
version: '3'
@ -660,7 +660,7 @@ Two special variables `{{.CHECKSUM}}` and `{{.TIMESTAMP}}` are available for int
Note that the `{{.TIMESTAMP}}` variable is a "live" Go `time.Time` struct, and can be formatted using any of the methods that `time.Time` responds to.
See [the Go Time documentation](https://golang.org/pkg/time/) for more information.
有关详细信息,请参阅 [Go Time 文档](https://golang.org/pkg/time/)。
You can use `--force` or `-f` if you want to force a task to run even when up-to-date.