1
0
mirror of https://github.com/go-task/task.git synced 2025-03-17 21:08:01 +02:00

Website: Sync translations (#1103)

This commit is contained in:
task-bot 2023-04-05 21:48:43 -03:00 committed by GitHub
parent a729ee6fca
commit 79fde26f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 413 additions and 412 deletions

View File

@ -1,34 +1,34 @@
{
"theme.ErrorPageContent.title": {
"message": "This page crashed.",
"message": "Esta página travou.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "Try again",
"message": "Tente novamente",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Page Not Found",
"message": "Página não encontrada",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "We could not find what you were looking for.",
"message": "Não foi possível encontrar o que você está procurando.",
"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.",
"message": "Entre em contato com o proprietário do site que lhe trouxe para cá e lhe informe que o link está quebrado.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "note",
"message": "nota",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "tip",
"message": "dica",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "danger",
"message": "atenção",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
@ -36,361 +36,361 @@
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "caution",
"message": "cuidado",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Scroll back to top",
"message": "Voltar para o topo",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
"message": "Archive",
"message": "Arquivo",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
"message": "Archive",
"message": "Arquivo",
"description": "The page & hero description of the blog archive page"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Blog list page navigation",
"message": "Navegação da página de listagem do blog",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Newer Entries",
"message": "Conteúdo mais novo",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Older Entries",
"message": "Conteúdo Mais Antigo",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Blog post page navigation",
"message": "Navegação da página de post do blog",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Newer Post",
"message": "Postagem mais recente",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Older Post",
"message": "Postagem mais antiga",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.post.plurals": {
"message": "One post|{count} posts",
"message": "Uma postagem|{count} postagens",
"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}\"",
"message": "{nPosts} marcadas com \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "View All Tags",
"message": "Ver todas as etiquetas",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "Switch between dark and light mode (currently {mode})",
"message": "Alternar entre o modo claro e escuro (atual {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "dark mode",
"message": "modo escuro",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "light mode",
"message": "modo claro",
"description": "The name for the light color mode"
},
"theme.docs.breadcrumbs.home": {
"message": "Home page",
"message": "Página inicial",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "Breadcrumbs",
"message": "Navegação estrutural",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count} items",
"message": "{count} itens",
"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",
"message": "Navegação das páginas da documentação",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Previous",
"message": "Anterior",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Next",
"message": "Próximo",
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "One doc tagged|{count} docs tagged",
"message": "Um documento com etiqueta |{count} documentos com etiquetas",
"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}\"",
"message": "{nDocsTagged} com \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "Version: {versionLabel}"
"message": "Versão: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
"message": "Esta é uma documentação não lançada para {siteTitle} versão {versionLabel}.",
"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.",
"message": "Esta é a documentação para {siteTitle} {versionLabel}, que não é mais mantida ativamente.",
"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}).",
"message": "Para a documentação atualizada, veja {latestVersionLink} ({versionLabel}).",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest version",
"message": "versão mais recente",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Edit this page",
"message": "Editar essa página",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Direct link to heading",
"message": "Link direto para o título",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " on {date}",
"message": " em {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " by {user}",
"message": " por {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Last updated{atDate}{byUser}",
"message": "Última atualização{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "Versions",
"message": "Versões",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.tags.tagsListLabel": {
"message": "Tags:",
"message": "Etiquetas:",
"description": "The label alongside a tag list"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Close",
"message": "Fechar",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "Blog recent posts navigation",
"message": "Navegação nas postagens recentes do blog",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.CodeBlock.copied": {
"message": "Copied",
"message": "Copiado",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copy code to clipboard",
"message": "Copiar código para a área de transferência",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copy": {
"message": "Copy",
"message": "Copiar",
"description": "The copy button label on code blocks"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap",
"message": "Alternar quebra de linha",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "Toggle the collapsible sidebar category '{label}'",
"message": "Alternar a categoria colapsável da barra lateral '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "Languages",
"message": "Idiomas",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "On this page",
"message": "Nesta página",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.blog.post.readMore": {
"message": "Read More",
"message": "Leia Mais",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.readMoreLabel": {
"message": "Read more about {title}",
"message": "Leia mais sobre {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",
"message": "Leitura de um minuto|Leitura de {readingTime} minutos",
"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",
"message": "Ocultar barra lateral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Collapse sidebar",
"message": "Ocultar barra lateral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "Close navigation bar",
"message": "Fechar barra de navegação",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← Back to main menu",
"message": "← Voltar ao menu principal",
"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",
"message": "Alternar barra de navegação",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Expand sidebar",
"message": "Expandir barra lateral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Expand sidebar",
"message": "Expandir barra lateral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.SearchBar.seeAll": {
"message": "See all {count} results"
"message": "Veja todos os {count} resultados"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "One document found|{count} documents found",
"message": "Um documento encontrado|{count} documentos encontrados",
"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}\"",
"message": "Resultado da busca por \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Search the documentation",
"message": "Pesquisar a documentação",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Type your search here",
"message": "Digite aqui o que você procura",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "Search",
"message": "Pesquisa",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Search by Algolia",
"message": "Busca feita por Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "No results were found",
"message": "Nenhum resultado encontrado",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Fetching new results...",
"message": "Trazendo novos resultados...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "Search",
"message": "Pesquisa",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "Clear the query",
"message": "Limpar a consulta",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "Cancel",
"message": "Cancelar",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "Recent",
"message": "Recente",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "No recent searches",
"message": "Nenhuma busca recente",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "Save this search",
"message": "Salvar esta busca",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "Remove this search from history",
"message": "Remover esta busca do histórico",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "Favorite",
"message": "Favorito",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "Remove this search from favorites",
"message": "Remover esta busca dos favoritos",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "Unable to fetch results",
"message": "Não foi possível carregar os resultados",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "You might want to check your network connection.",
"message": "Verifique se a sua conexão de internet está funcionando.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "to select",
"message": "para selecionar",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Enter key",
"message": "Tecla Enter",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "to navigate",
"message": "para navegar",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "Arrow up",
"message": "Seta para cima",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "Arrow down",
"message": "Seta para baixo",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "to close",
"message": "para fechar",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Escape key",
"message": "Tecla Esc",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "Search by",
"message": "Pesquisar por",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "No results for",
"message": "Nenhum resultado para",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "Try searching for",
"message": "Tente pesquisar por",
"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?",
"message": "Acredita que esta pesquisa devia retornar resultados?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "Let us know.",
"message": "Conte para nós.",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "Search docs",
"message": "Pesquisar na documentação",
"description": "The placeholder of the input of the DocSearch pop-up modal"
},
"theme.common.skipToMainContent": {
"message": "Skip to main content",
"message": "Pular para o conteúdo principal",
"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",
"message": "Etiquetas",
"description": "The title of the tag list page"
}
}

View File

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

View File

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

View File

@ -17,12 +17,10 @@ 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. |
@ -137,7 +135,6 @@ Some environment variables can be overriden to adjust Task behavior.
:::info
Informing only a string like below is equivalent to setting that value to the `taskfile` attribute.
```yaml
@ -147,7 +144,6 @@ includes:
:::
### Variable
| Attribute | Type | Default | Description |
@ -157,7 +153,6 @@ includes:
:::info
Static and dynamic variables have different syntaxes, like below:
```yaml
@ -169,7 +164,6 @@ vars:
:::
### Task
| Attribute | Type | Default | Description |
@ -201,7 +195,6 @@ vars:
:::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
@ -218,7 +211,6 @@ tasks:
:::
#### Command
| Attribute | Type | Default | Description |
@ -235,7 +227,6 @@ tasks:
:::info
If given as a a string, the value will be assigned to `cmd`:
```yaml
@ -248,7 +239,6 @@ tasks:
:::
#### Dependency
| Attribute | Type | Default | Description |
@ -258,7 +248,6 @@ tasks:
:::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
@ -269,7 +258,6 @@ tasks:
:::
#### Precondition
| Attribute | Type | Default | Description |
@ -279,7 +267,6 @@ tasks:
:::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

View File

@ -14,9 +14,9 @@ Contributions to Task are very welcome, but we ask that you read this document b
## 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.
- **Go** - Task is written in [Go][]. We always support the latest two major Go versions, so make sure your version is recent enough.
- **Node.js** - [Node.js][] is used to host Task's documentation server and is required if you want to run this server locally.
- **Yarn** - [Yarn][] is the Node.js package manager used by Task.
## 2. Making changes
@ -31,11 +31,11 @@ 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.
Task uses [Docusaurus][] 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.
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][]. The descriptions for fields in the API reference and the schema should match.
### Writing tests
@ -58,12 +58,22 @@ Try to write meaningful commit messages and avoid having too many commits on the
> 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.
Take a look at the list of [open issues][]. We have a [good first issue][] 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.
If you have questions, feel free to ask them in the `#help` forum channel on our [Discord server][] or open a [Discussion][] on GitHub.
---
[Go]: https://go.dev
[Node.js]: https://nodejs.org/en/
[Yarn]: https://yarnpkg.com/
[Docusaurus]: https://docusaurus.io
[JSON Schema]: https://github.com/go-task/task/blob/master/docs/static/schema.json
[open issues]: https://github.com/go-task/task/issues
[good first issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[Discord server]: https://discord.gg/6TY36E39UK
[Discussion]: https://github.com/go-task/task/discussions

View File

@ -3,37 +3,39 @@ slug: /donate/
sidebar_position: 12
---
# Donate
# Doe
If you find this project useful, you can consider donating by using one of the channels listed below.
Se você acha esse projeto útil, considere doar usando um dos meios listados abaixo.
This is just a way of saying "thank you", it won't give you any benefits like higher priority on issues or something similar.
Esta é apenas uma maneira de dizer "obrigado", ele não lhe dará nenhum benefício como maior prioridade em issues ou algo parecido.
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.
As empresas que doarem pelo menos $50/mês ganharão destaque como "Patrocinador Ouro" na página do site e no README do repositório no GitHub. Faça contato com [@andreynering][] com o logotipo que você deseja ser mostrado no site. Nogócios suspeitos (apostas, cassinos, etc) não serão permitidos, porém.
## GitHub Sponsors
The preferred way to donate to the maintainers is via GitHub Sponsors. Just use the following links to do your donation:
A forma sugerida de doar para os mantenedores é através do GitHub Sponsors. Basta usar os seguintes links para fazer a sua doação:
- [@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:
Se você preferir o [Open Collective](https://opencollective.com/task) você pode doar usando um destes 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)
- [$2 por mês](https://opencollective.com/task/contribute/backer-4034/checkout)
- [$5 por mês](https://opencollective.com/task/contribute/supporter-8404/checkout)
- [$20 por mês](https://opencollective.com/task/contribute/sponsor-4035/checkout)
- [$50 por mês](https://opencollective.com/task/contribute/sponsor-28775/checkout)
- [Valor personalizado - Essa opção também suporta doar uma única vez](https://opencollective.com/task/donate)
## PayPal
You can donate to [@andreynering](https://github.com/andreynering) via PayPal as well:
Você pode doar para [@andreynering][] através do PayPal também:
- [Any value - One-time donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url)
- [Qualquer valor - Doação única](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A&currency_code=USD&source=url)
## PIX (Brazil only)
## PIX (somente para o Brasil)
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).
E se você é brasileiro, também pode doar para [@andreynering][] via PIX [usando este QR Code](/img/pix.png).
[@andreynering]: https://github.com/andreynering

View File

@ -31,10 +31,13 @@ The default shell on Windows (`cmd` and `powershell`) do not have commands like
- 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).
- Use a shell on Windows that supports these commands as builtins, such as [Git Bash][] or [WSL][].
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)
[Git Bash]: https://gitforwindows.org/
[WSL]: https://learn.microsoft.com/en-us/windows/wsl/install

View File

@ -11,7 +11,7 @@ Task offers many installation methods. Check out the available methods below.
### Homebrew
If you're on macOS or Linux and have [Homebrew](https://brew.sh/) installed, getting Task is as simple as running:
If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting Task is as simple as running:
```bash
brew install go-task/tap/go-task
@ -27,7 +27,7 @@ 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:
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux distribution should allow classic confinement for Snaps to Task work right:
```bash
sudo snap install task --classic
@ -35,7 +35,7 @@ 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:
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as simple as running:
```bash
choco install go-task
@ -45,7 +45,7 @@ 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:
If you're on Windows and have [Scoop][scoop] installed, getting Task is as simple as running:
```cmd
scoop install task
@ -97,11 +97,19 @@ You can also use Node and npm to install Task by installing [this package](https
npm install -g @go-task/cli
```
### Winget
If you are using Windows and installed the [winget](https://github.com/microsoft/winget-cli) package management tool, you can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
```bash
winget install Task.Task
```
## 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`.
You can download the binary from the [releases page on GitHub][releases] and add to your `$PATH`.
DEB and RPM packages are also available.
@ -109,7 +117,7 @@ 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.
We also have an [install script][installscript] which is very useful in scenarios like CI. Many thanks to [GoDownloader][godownloader] for enabling the easy generation of this script.
By default, it installs on the `./bin` directory relative to the working directory:
@ -125,12 +133,10 @@ 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:
@ -138,6 +144,9 @@ If you want to install Task in GitHub Actions you can try using [this action](ht
```yaml
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
This installation method is community owned.
@ -146,7 +155,7 @@ This installation method is community owned.
### 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.
Ensure that you have a supported version of [Go][go] 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:
@ -162,12 +171,10 @@ 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.
For CI environments we recommend using the [install script](#install-script) 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.
@ -229,3 +236,12 @@ Add the line and save the file:
```shell
Invoke-Expression -Command path/to/task.ps1
```
[go]: https://golang.org/
[snapcraft]: https://snapcraft.io/task
[homebrew]: https://brew.sh/
[installscript]: https://github.com/go-task/task/blob/master/install-task.sh
[releases]: https://github.com/go-task/task/releases
[godownloader]: https://github.com/goreleaser/godownloader
[choco]: https://chocolatey.org/
[scoop]: https://scoop.sh/

View File

@ -1,7 +1,7 @@
---
slug: /
sidebar_position: 1
title: Home
title: Página Inicial
---
# Task
@ -10,11 +10,11 @@ title: Home
<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/).
Task é uma ferramenta de automatização de tarefas que foi criada para ser mais simples de usar do que outras similares, como por exemplo o [GNU Make][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.
Por ser escrito em [Go][go], o Task é simplesmente um binário e não possui nenhuma outra dependência, o que significa que você não precisa lidar com um processo de instalação complicado apenas para usar uma ferramenta de automação.
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`:
Uma vez [instalado](installation.md), você só precisa só precisa escrever suas tarefas usando um esquema [YAML][yaml] simples num arquivo chamado `Taskfile.yml`:
```yaml title="Taskfile.yml"
version: '3'
@ -26,18 +26,18 @@ tasks:
silent: true
```
And call it by running `task hello` from your terminal.
E invocá-lo ao rodar `task hello` do seu 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.
O exemplo acima é apenas o começo. Você pode dar uma olhada no [guia de uso](/usage) para conferir a documentação completa do esquema e as funcionalidades do Task.
## Features
## Funcionalidades
- [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).
- [Instalação fácil](installation.md): apenas baixe um único binário, adicione-o a `$PATH` e pronto! Ou você também pode instalá-lo usando [Homebrew][homebrew], [Snapcraft][snapcraft] ou [Scoop][scoop] se você quiser.
- Disponível em CIs: adicionando [este script simples](installation.md#install-script) para instalá-lo no seu CI você estará pronto para usar o Task como parte do seu pipeline de CI;
- Verdadeiramente multiplataforma: enquanto a maioria das ferramentas de compilação só funcionam bem no Linux ou macOS, o Task também suporta Windows graças [a este interpretador de shell para Go][sh].
- Ótimo para a geração de código: você pode facilmente [impedir que uma tarefa execute](/usage#prevent-unnecessary-work) se um determinado conjunto de arquivos não tiver mudado desde a última execução (baseado na data de modificação ou conteúdo dos arquivos).
## Gold Sponsors
## Patrocinadores de Ouro
<div class="gold-sponsors">
@ -46,3 +46,10 @@ The above example is just the start, you can take a look at the [usage](/usage)
| [![Appwrite](/img/appwrite.svg)](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
</div>
[make]: https://www.gnu.org/software/make/
[go]: https://go.dev/
[yaml]: http://yaml.org/
[homebrew]: https://brew.sh/
[snapcraft]: https://snapcraft.io/
[scoop]: https://scoop.sh/
[sh]: https://github.com/mvdan/sh

View File

@ -5,7 +5,7 @@ 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.
The release process of Task is done with the help of [GoReleaser][goreleaser]. 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).
@ -13,18 +13,18 @@ Since v3.15.0, raw executables can also be reproduced and verified locally by ch
# 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.
Goreleaser will automatically push a new commit to the [Formula/go-task.rb][gotaskrb] file in the [Homebrew tap][homebrewtap] 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.
To release to npm update the version in the [`package.json`][packagejson] 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:
The [snap package][snappackage] 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).
* Updating the current version on [snapcraft.yaml][snapcraftyaml].
* Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel on the [Snapcraft dashboard][snapcraftdashboard].
# Scoop
@ -33,3 +33,11 @@ Scoop is a command-line package manager for the Windows operating system. Scoop
# 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.
[goreleaser]: https://goreleaser.com/
[homebrewtap]: https://github.com/go-task/homebrew-tap
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb
[packagejson]: https://github.com/go-task/task/blob/master/package.json#L3
[snappackage]: https://github.com/go-task/snap
[snapcraftyaml]: https://github.com/go-task/snap/blob/master/snap/snapcraft.yaml#L2
[snapcraftdashboard]: https://snapcraft.io/task/releases

View File

@ -89,7 +89,7 @@ tasks:
## 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):
Version 2.1 includes a global `output` option, to allow having more control over how commands output are printed to the console (see [documentation][output] for more info):
```yaml
version: '2'
@ -103,7 +103,7 @@ tasks:
prefix: server
```
From this version it's also possible to ignore errors of a command or task (check documentation [here](usage.md#ignore-errors)):
From this version it's also possible to ignore errors of a command or task (check documentation [here][ignore_errors]):
```yaml
version: '2'
@ -149,7 +149,7 @@ tasks:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation](usage.md#including-other-taskfiles)
Please check the [documentation][includes]
## Version 3
@ -202,3 +202,7 @@ tasks:
- Global + CLI variables
- Call variables
- Task variables
[output]: usage.md#output-syntax
[ignore_errors]: usage.md#ignore-errors
[includes]: usage.md#including-other-taskfiles

View File

@ -3,10 +3,13 @@ slug: /translate/
sidebar_position: 13
---
# Translate
# Traduza
Want to help us translate this documentation? In this document we explain how.
Quer nos ajudar a traduzir esta documentação? Neste documento, explicamos como.
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.
NÃO edite os arquivos markdown traduzidos diretamente no repositório do GitHub! Nós usamos o [Crowdin][crowdin] para permitir que os contribuidores trabalhem nas traduções. O repositório é atualizado periodicamente com o progresso no 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.
Se você quer ter acesso ao projeto Crowdin para ser capaz de sugerir traduções, por favor, peça acesso no canal de [#translations no nosso servidor do Discord][discord]. Se um determinado idioma ainda não está sendo mostrado ao Crowdin, basta pedir e podemos configurá-lo.
[crowdin]: https://crowdin.com/project/taskfile
[discord]: https://discord.gg/6TY36E39UK

View File

@ -71,7 +71,6 @@ This is useful to have automation that you can run from anywhere in your system!
:::info
When running your global Taskfile with `-g`, tasks will run on `$HOME` by default, and not on your working directory!
As mentioned in the previous section, the `{{.USER_WORKING_DIR}}` special variable can be very handy here to run stuff on the directory you're calling `task -g` from.
@ -92,7 +91,6 @@ tasks:
:::
## Environment variables
### Task
@ -126,12 +124,10 @@ 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 files
You can also ask Task to include `.env` like files by using the `dotenv:` setting:
@ -192,12 +188,10 @@ tasks:
:::info
Please note that you are not currently able to use the `dotenv` key inside included Taskfiles.
:::
## Including other Taskfiles
If you want to share tasks between different projects (Taskfiles), you can use the importing mechanism to include other Taskfiles using the `includes` keyword:
@ -240,12 +234,10 @@ includes:
:::info
The included Taskfiles must be using the same schema version as the main Taskfile uses.
:::
### Optional includes
Includes marked as optional will allow Task to continue execution as normal if the included file is missing.
@ -311,12 +303,10 @@ includes:
:::info
Vars declared in the included Taskfile have preference over the variables in the including Taskfile! If you want a variable in an included Taskfile to be overridable, use the [default function](https://go-task.github.io/slim-sprig/defaults.html): `MY_VAR: '{{.MY_VAR | default "my-default-value"}}'`.
:::
## Internal tasks
Internal tasks are tasks that cannot be called directly by the user. They will not appear in the output when running `task --list|--list-all`. Other tasks may call internal tasks in the usual way. This is useful for creating reusable, function-like tasks that have no useful purpose on the command line.
@ -398,12 +388,10 @@ If there is more than one dependency, they always run in parallel for better per
:::tip
You can also make the tasks given by the command line run in parallel by using the `--parallel` flag (alias `-p`). Example: `task --parallel js css`.
:::
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):
```yaml
@ -536,12 +524,10 @@ The above syntax is also supported in `deps`.
:::tip
NOTE: If you want to call a task declared in the root Taskfile from within an [included Taskfile](#including-other-taskfiles), add a leading `:` like this: `task: :task-name`.
:::
## Prevent unnecessary work
### By fingerprinting locally generated files and their sources
@ -596,7 +582,6 @@ In situations where you need more flexibility the `status` keyword can be used.
:::info
By default, task stores checksums on a local `.task` directory in the project's directory. Most of the time, you'll want to have this directory on `.gitignore` (or equivalent) so it isn't committed. (If you have a task for code generation that is committed it may make sense to commit the checksum of that task as well, though).
If you want these files to be stored in another directory, you can set a `TASK_TEMP_DIR` environment variable in your machine. It can contain a relative path like `tmp/task` that will be interpreted as relative to the project directory, or an absolute or home path like `/tmp/.task` or `~/.task` (subdirectories will be created for each project).
@ -607,33 +592,26 @@ export TASK_TEMP_DIR='~/.task'
:::
:::info
Each task has only one checksum stored for its `sources`. If you want to distinguish a task by any of its input variables, you can add those variables as part of the task's label, and it will be considered a different task.
This is useful if you want to run a task once for each distinct set of inputs until the sources actually change. For example, if the sources depend on the value of a variable, or you if you want the task to rerun if some arguments change even if the source has not.
:::
:::tip
The method `none` skips any validation and always run the task.
:::
:::info
For the `checksum` (default) or `timestamp` method to work, it is only necessary to inform the source files. When the `timestamp` method is used, the last time of the running the task is considered as a generate.
:::
### Using programmatic checks to indicate a task is up to date.
Alternatively, you can inform a sequence of tests as `status`. If no error is returned (exit status 0), the task is considered up-to-date:
@ -787,12 +765,10 @@ $ TASK_VARIABLE=a-value task do-something
:::tip
A special variable `.TASK` is always available containing the task name.
:::
Since some shells do not support the above syntax to set environment variables (Windows) tasks also accept a similar style when not at the beginning of the command.
```bash
@ -897,15 +873,13 @@ tasks:
:::info
Due to the nature of how the [Go's own `defer` work](https://go.dev/tour/flowcontrol/13), the deferred commands are executed in the reverse order if you schedule multiple of them.
:::
## Go's template engine
Task parse commands as [Go's template engine](https://golang.org/pkg/text/template/) before executing them. Variables are accessible through dot syntax (`.VARNAME`).
Task parse commands as [Go's template engine][gotemplate] before executing them. Variables are accessible through dot syntax (`.VARNAME`).
All functions by the Go's [slim-sprig lib](https://go-task.github.io/slim-sprig/) are available. The following example gets the current date in a given format:
@ -1289,12 +1263,10 @@ $ task default
:::tip
The `output` option can also be specified by the `--output` or `-o` flags.
:::
## Interactive CLI application
When running interactive CLI applications inside Task they can sometimes behave weirdly, especially when the [output mode](#output-syntax) is set to something other than `interleaved` (the default), or when interactive apps are run in parallel with other tasks.
@ -1345,14 +1317,14 @@ tasks:
:::info
Keep in mind that not all options are available in the [shell interpreter library](https://github.com/mvdan/sh) that Task uses.
:::
## Watch tasks
With the flags `--watch` or `-w` task will watch for file changes and run the task again. This requires the `sources` attribute to be given, so task knows which files to watch.
The default watch interval is 5 seconds, but it's possible to change it by either setting `interval: '500ms'` in the root of the Taskfile passing it as an argument like `--interval=500ms`.
[gotemplate]: https://golang.org/pkg/text/template/

View File

@ -1,26 +1,26 @@
{
"link.title.Pages": {
"message": "Pages",
"message": "Páginas",
"description": "The title of the footer links column with title=Pages in the footer"
},
"link.title.Community": {
"message": "Community",
"message": "Comunidade",
"description": "The title of the footer links column with title=Community in the footer"
},
"link.title.Translations": {
"message": "Translations",
"message": "Traduções",
"description": "The title of the footer links column with title=Translations in the footer"
},
"link.item.label.Installation": {
"message": "Installation",
"message": "Instalação",
"description": "The label of footer link with label=Installation linking to /installation/"
},
"link.item.label.Usage": {
"message": "Usage",
"message": "Guia de Uso",
"description": "The label of footer link with label=Usage linking to /usage/"
},
"link.item.label.Donate": {
"message": "Donate",
"message": "Doe",
"description": "The label of footer link with label=Donate linking to /donate/"
},
"link.item.label.GitHub": {
@ -44,7 +44,7 @@
"description": "The label of footer link with label=OpenCollective linking to https://opencollective.com/task"
},
"link.item.label.Chinese | 中国人": {
"message": "Chinese | 中国人",
"message": "Chinês | 中国人",
"description": "The label of footer link with label=Chinese | 中国人 linking to https://task-zh.readthedocs.io/zh_CN/latest/"
}
}

View File

@ -4,11 +4,11 @@
"description": "The title in the navbar"
},
"item.label.Installation": {
"message": "Installation",
"message": "Instalação",
"description": "Navbar item with label Installation"
},
"item.label.Usage": {
"message": "Usage",
"message": "Guia de Uso",
"description": "Navbar item with label Usage"
},
"item.label.API": {
@ -16,7 +16,7 @@
"description": "Navbar item with label API"
},
"item.label.Donate": {
"message": "Donate",
"message": "Doe",
"description": "Navbar item with label Donate"
},
"item.label.GitHub": {

View File

@ -17,12 +17,10 @@ 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. |
@ -137,7 +135,6 @@ Some environment variables can be overriden to adjust Task behavior.
:::info
Informing only a string like below is equivalent to setting that value to the `taskfile` attribute.
```yaml
@ -147,7 +144,6 @@ includes:
:::
### Variable
| Attribute | Type | Default | Description |
@ -157,7 +153,6 @@ includes:
:::info
Static and dynamic variables have different syntaxes, like below:
```yaml
@ -169,7 +164,6 @@ vars:
:::
### Task
| Attribute | Type | Default | Description |
@ -201,7 +195,6 @@ vars:
:::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
@ -218,7 +211,6 @@ tasks:
:::
#### Command
| Attribute | Type | Default | Description |
@ -235,7 +227,6 @@ tasks:
:::info
If given as a a string, the value will be assigned to `cmd`:
```yaml
@ -248,7 +239,6 @@ tasks:
:::
#### Dependency
| Attribute | Type | Default | Description |
@ -258,7 +248,6 @@ tasks:
:::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
@ -269,7 +258,6 @@ tasks:
:::
#### Precondition
| Attribute | Type | Default | Description |
@ -279,7 +267,6 @@ tasks:
:::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

View File

@ -14,9 +14,9 @@ Contributions to Task are very welcome, but we ask that you read this document b
## 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.
- **Go** - Task is written in [Go][]. We always support the latest two major Go versions, so make sure your version is recent enough.
- **Node.js** - [Node.js][] is used to host Task's documentation server and is required if you want to run this server locally.
- **Yarn** - [Yarn][] is the Node.js package manager used by Task.
## 2. Making changes
@ -31,11 +31,11 @@ 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.
Task uses [Docusaurus][] 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.
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][]. The descriptions for fields in the API reference and the schema should match.
### Writing tests
@ -58,12 +58,22 @@ Try to write meaningful commit messages and avoid having too many commits on the
> 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.
Take a look at the list of [open issues][]. We have a [good first issue][] 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.
If you have questions, feel free to ask them in the `#help` forum channel on our [Discord server][] or open a [Discussion][] on GitHub.
---
[Go]: https://go.dev
[Node.js]: https://nodejs.org/en/
[Yarn]: https://yarnpkg.com/
[Docusaurus]: https://docusaurus.io
[JSON Schema]: https://github.com/go-task/task/blob/master/docs/static/schema.json
[open issues]: https://github.com/go-task/task/issues
[good first issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[Discord server]: https://discord.gg/6TY36E39UK
[Discussion]: https://github.com/go-task/task/discussions

View File

@ -9,7 +9,7 @@ If you find this project useful, you can consider donating by using one of the c
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.
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][] with the logo you want to be shown. Suspect businesses (gambling, casinos, etc) won't be allowed, though.
## GitHub Sponsors
@ -30,10 +30,12 @@ If you prefer [Open Collective](https://opencollective.com/task) you can donate
## PayPal
You can donate to [@andreynering](https://github.com/andreynering) via PayPal as well:
You can donate to [@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).
And if you're Brazilian, you can also donate to [@andreynering][] via PIX by [using this QR Code](/img/pix.png).
[@andreynering]: https://github.com/andreynering

View File

@ -31,10 +31,13 @@ The default shell on Windows (`cmd` and `powershell`) do not have commands like
- 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).
- Use a shell on Windows that supports these commands as builtins, such as [Git Bash][] or [WSL][].
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)
[Git Bash]: https://gitforwindows.org/
[WSL]: https://learn.microsoft.com/en-us/windows/wsl/install

View File

@ -11,7 +11,7 @@ Task offers many installation methods. Check out the available methods below.
### Homebrew
If you're on macOS or Linux and have [Homebrew](https://brew.sh/) installed, getting Task is as simple as running:
If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting Task is as simple as running:
```bash
brew install go-task/tap/go-task
@ -27,7 +27,7 @@ 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:
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux distribution should allow classic confinement for Snaps to Task work right:
```bash
sudo snap install task --classic
@ -35,7 +35,7 @@ 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:
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as simple as running:
```bash
choco install go-task
@ -45,7 +45,7 @@ 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:
If you're on Windows and have [Scoop][scoop] installed, getting Task is as simple as running:
```cmd
scoop install task
@ -97,11 +97,19 @@ You can also use Node and npm to install Task by installing [this package](https
npm install -g @go-task/cli
```
### Winget
If you are using Windows and installed the [winget](https://github.com/microsoft/winget-cli) package management tool, you can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
```bash
winget install Task.Task
```
## 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`.
You can download the binary from the [releases page on GitHub][releases] and add to your `$PATH`.
DEB and RPM packages are also available.
@ -109,7 +117,7 @@ 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.
We also have an [install script][installscript] which is very useful in scenarios like CI. Many thanks to [GoDownloader][godownloader] for enabling the easy generation of this script.
By default, it installs on the `./bin` directory relative to the working directory:
@ -125,12 +133,10 @@ 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:
@ -138,6 +144,9 @@ If you want to install Task in GitHub Actions you can try using [this action](ht
```yaml
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
This installation method is community owned.
@ -146,7 +155,7 @@ This installation method is community owned.
### 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.
Ensure that you have a supported version of [Go][go] 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:
@ -162,12 +171,10 @@ 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.
For CI environments we recommend using the [install script](#install-script) 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.
@ -229,3 +236,12 @@ Add the line and save the file:
```shell
Invoke-Expression -Command path/to/task.ps1
```
[go]: https://golang.org/
[snapcraft]: https://snapcraft.io/task
[homebrew]: https://brew.sh/
[installscript]: https://github.com/go-task/task/blob/master/install-task.sh
[releases]: https://github.com/go-task/task/releases
[godownloader]: https://github.com/goreleaser/godownloader
[choco]: https://chocolatey.org/
[scoop]: https://scoop.sh/

View File

@ -10,11 +10,11 @@ title: Home
<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/).
Task is a task runner / build tool that aims to be simpler and easier to use than, for example, [GNU Make][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.
Since it's written in [Go][go], 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`:
Once [installed](installation.md), you just need to describe your build tasks using a simple [YAML][yaml] schema in a file called `Taskfile.yml`:
```yaml title="Taskfile.yml"
version: '3'
@ -32,9 +32,9 @@ The above example is just the start, you can take a look at the [usage](/usage)
## 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.
- [Easy installation](installation.md): just download a single binary, add to `$PATH` and you're done! Or you can also install using [Homebrew][homebrew], [Snapcraft][snapcraft], or [Scoop][scoop] 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).
- 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][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
@ -46,3 +46,10 @@ The above example is just the start, you can take a look at the [usage](/usage)
| [![Appwrite](/img/appwrite.svg)](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
</div>
[make]: https://www.gnu.org/software/make/
[go]: https://go.dev/
[yaml]: http://yaml.org/
[homebrew]: https://brew.sh/
[snapcraft]: https://snapcraft.io/
[scoop]: https://scoop.sh/
[sh]: https://github.com/mvdan/sh

View File

@ -5,7 +5,7 @@ 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.
The release process of Task is done with the help of [GoReleaser][goreleaser]. 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).
@ -13,18 +13,18 @@ Since v3.15.0, raw executables can also be reproduced and verified locally by ch
# 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.
Goreleaser will automatically push a new commit to the [Formula/go-task.rb][gotaskrb] file in the [Homebrew tap][homebrewtap] 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.
To release to npm update the version in the [`package.json`][packagejson] 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:
The [snap package][snappackage] 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).
* Updating the current version on [snapcraft.yaml][snapcraftyaml].
* Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel on the [Snapcraft dashboard][snapcraftdashboard].
# Scoop
@ -33,3 +33,11 @@ Scoop is a command-line package manager for the Windows operating system. Scoop
# 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.
[goreleaser]: https://goreleaser.com/
[homebrewtap]: https://github.com/go-task/homebrew-tap
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/master/Formula/go-task.rb
[packagejson]: https://github.com/go-task/task/blob/master/package.json#L3
[snappackage]: https://github.com/go-task/snap
[snapcraftyaml]: https://github.com/go-task/snap/blob/master/snap/snapcraft.yaml#L2
[snapcraftdashboard]: https://snapcraft.io/task/releases

View File

@ -89,7 +89,7 @@ tasks:
## 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):
Version 2.1 includes a global `output` option, to allow having more control over how commands output are printed to the console (see [documentation][output] for more info):
```yaml
version: '2'
@ -103,7 +103,7 @@ tasks:
prefix: server
```
From this version it's also possible to ignore errors of a command or task (check documentation [here](usage.md#ignore-errors)):
From this version it's also possible to ignore errors of a command or task (check documentation [here][ignore_errors]):
```yaml
version: '2'
@ -149,7 +149,7 @@ tasks:
- aws s3 cp .env s3://myenvironment
```
Please check the [documentation](usage.md#including-other-taskfiles)
Please check the [documentation][includes]
## Version 3
@ -202,3 +202,7 @@ tasks:
- Global + CLI variables
- Call variables
- Task variables
[output]: usage.md#output-syntax
[ignore_errors]: usage.md#ignore-errors
[includes]: usage.md#including-other-taskfiles

View File

@ -7,6 +7,9 @@ sidebar_position: 13
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.
Do NOT edit translated markdown files directly on the GitHub repository! We use [Crowdin][crowdin] 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.
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][discord]. If a given language is not being shown to Crowdin yet, just ask and we can configure it.
[crowdin]: https://crowdin.com/project/taskfile
[discord]: https://discord.gg/6TY36E39UK

View File

@ -71,7 +71,6 @@ This is useful to have automation that you can run from anywhere in your system!
:::info
When running your global Taskfile with `-g`, tasks will run on `$HOME` by default, and not on your working directory!
As mentioned in the previous section, the `{{.USER_WORKING_DIR}}` special variable can be very handy here to run stuff on the directory you're calling `task -g` from.
@ -92,7 +91,6 @@ tasks:
:::
## Environment variables
### Task
@ -126,12 +124,10 @@ 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 files
You can also ask Task to include `.env` like files by using the `dotenv:` setting:
@ -192,12 +188,10 @@ tasks:
:::info
Please note that you are not currently able to use the `dotenv` key inside included Taskfiles.
:::
## Including other Taskfiles
If you want to share tasks between different projects (Taskfiles), you can use the importing mechanism to include other Taskfiles using the `includes` keyword:
@ -240,12 +234,10 @@ includes:
:::info
The included Taskfiles must be using the same schema version as the main Taskfile uses.
:::
### Optional includes
Includes marked as optional will allow Task to continue execution as normal if the included file is missing.
@ -311,12 +303,10 @@ includes:
:::info
Vars declared in the included Taskfile have preference over the variables in the including Taskfile! If you want a variable in an included Taskfile to be overridable, use the [default function](https://go-task.github.io/slim-sprig/defaults.html): `MY_VAR: '{{.MY_VAR | default "my-default-value"}}'`.
:::
## Internal tasks
Internal tasks are tasks that cannot be called directly by the user. They will not appear in the output when running `task --list|--list-all`. Other tasks may call internal tasks in the usual way. This is useful for creating reusable, function-like tasks that have no useful purpose on the command line.
@ -398,12 +388,10 @@ If there is more than one dependency, they always run in parallel for better per
:::tip
You can also make the tasks given by the command line run in parallel by using the `--parallel` flag (alias `-p`). Example: `task --parallel js css`.
:::
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):
```yaml
@ -536,12 +524,10 @@ The above syntax is also supported in `deps`.
:::tip
NOTE: If you want to call a task declared in the root Taskfile from within an [included Taskfile](#including-other-taskfiles), add a leading `:` like this: `task: :task-name`.
:::
## Prevent unnecessary work
### By fingerprinting locally generated files and their sources
@ -596,7 +582,6 @@ In situations where you need more flexibility the `status` keyword can be used.
:::info
By default, task stores checksums on a local `.task` directory in the project's directory. Most of the time, you'll want to have this directory on `.gitignore` (or equivalent) so it isn't committed. (If you have a task for code generation that is committed it may make sense to commit the checksum of that task as well, though).
If you want these files to be stored in another directory, you can set a `TASK_TEMP_DIR` environment variable in your machine. It can contain a relative path like `tmp/task` that will be interpreted as relative to the project directory, or an absolute or home path like `/tmp/.task` or `~/.task` (subdirectories will be created for each project).
@ -607,33 +592,26 @@ export TASK_TEMP_DIR='~/.task'
:::
:::info
Each task has only one checksum stored for its `sources`. If you want to distinguish a task by any of its input variables, you can add those variables as part of the task's label, and it will be considered a different task.
This is useful if you want to run a task once for each distinct set of inputs until the sources actually change. For example, if the sources depend on the value of a variable, or you if you want the task to rerun if some arguments change even if the source has not.
:::
:::tip
The method `none` skips any validation and always run the task.
:::
:::info
For the `checksum` (default) or `timestamp` method to work, it is only necessary to inform the source files. When the `timestamp` method is used, the last time of the running the task is considered as a generate.
:::
### Using programmatic checks to indicate a task is up to date.
Alternatively, you can inform a sequence of tests as `status`. If no error is returned (exit status 0), the task is considered up-to-date:
@ -787,12 +765,10 @@ $ TASK_VARIABLE=a-value task do-something
:::tip
A special variable `.TASK` is always available containing the task name.
:::
Since some shells do not support the above syntax to set environment variables (Windows) tasks also accept a similar style when not at the beginning of the command.
```bash
@ -897,15 +873,13 @@ tasks:
:::info
Due to the nature of how the [Go's own `defer` work](https://go.dev/tour/flowcontrol/13), the deferred commands are executed in the reverse order if you schedule multiple of them.
:::
## Go's template engine
Task parse commands as [Go's template engine](https://golang.org/pkg/text/template/) before executing them. Variables are accessible through dot syntax (`.VARNAME`).
Task parse commands as [Go's template engine][gotemplate] before executing them. Variables are accessible through dot syntax (`.VARNAME`).
All functions by the Go's [slim-sprig lib](https://go-task.github.io/slim-sprig/) are available. The following example gets the current date in a given format:
@ -1289,12 +1263,10 @@ $ task default
:::tip
The `output` option can also be specified by the `--output` or `-o` flags.
:::
## Interactive CLI application
When running interactive CLI applications inside Task they can sometimes behave weirdly, especially when the [output mode](#output-syntax) is set to something other than `interleaved` (the default), or when interactive apps are run in parallel with other tasks.
@ -1345,14 +1317,14 @@ tasks:
:::info
Keep in mind that not all options are available in the [shell interpreter library](https://github.com/mvdan/sh) that Task uses.
:::
## Watch tasks
With the flags `--watch` or `-w` task will watch for file changes and run the task again. This requires the `sources` attribute to be given, so task knows which files to watch.
The default watch interval is 5 seconds, but it's possible to change it by either setting `interval: '500ms'` in the root of the Taskfile passing it as an argument like `--interval=500ms`.
[gotemplate]: https://golang.org/pkg/text/template/

View File

@ -17,12 +17,10 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
:::tip
如果 `--` 给出,所有剩余参数将被分配给一个特殊的 `CLI_ARGS` 变量
:::
| 缩写 | 标志 | 类型 | 默认 | 描述 |
| ---- | --------------------------- | -------- | -------------------------------- | --------------------------------------------------------------------------------------------------- |
| `-c` | `--color` | `bool` | `true` | 彩色输出。 默认开启。 设置为 `false` 或使用 `NO_COLOR=1` 禁用。 |
@ -137,7 +135,6 @@ task [--flags] [tasks...] [-- CLI_ARGS...]
:::info
像下面这样只赋值一个字符串,和把这个值设置到 `taskfile` 属性是一样的。
```yaml
@ -147,7 +144,6 @@ includes:
:::
### Variable
| 属性 | 类型 | 默认 | 描述 |
@ -157,7 +153,6 @@ includes:
:::info
静态和动态变量有不同的语法,如下所示:
```yaml
@ -169,7 +164,6 @@ vars:
:::
### Task
| 属性 | 类型 | 默认 | 描述 |
@ -201,7 +195,6 @@ vars:
:::info
这些替代语法可用。 他们会将给定值设置为 `cmds`,其他所有内容都将设置为其默认值:
```yaml
@ -218,7 +211,6 @@ tasks:
:::
#### Command
| 属性 | 类型 | 默认 | 描述 |
@ -235,7 +227,6 @@ tasks:
:::info
如果以字符串形式给出,该值将分配给 `cmd`
```yaml
@ -248,7 +239,6 @@ tasks:
:::
#### Dependency
| 属性 | 类型 | 默认 | 描述 |
@ -258,7 +248,6 @@ tasks:
:::tip
如果你不想设置额外的变量,将依赖关系声明为一个字符串列表就足够了(它们将被分配给 `task`)。
```yaml
@ -269,7 +258,6 @@ tasks:
:::
#### Precondition
| 属性 | 类型 | 默认 | 描述 |
@ -279,7 +267,6 @@ tasks:
:::tip
如果你不想设置不同的消息,你可以像这样声明一个前提条件,值将被分配给 `sh`
```yaml

View File

@ -7,7 +7,7 @@ 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)!
Task 现在已经有了一个由 [@pd93](https://github.com/pd93) 贡献的 [Visual Studio Code 官方扩展程序](https://marketplace.visualstudio.com/items?itemName=task.vscode-task)! :tada:该扩展现在在 `go-task` 组织的 [新存储库](https://github.com/go-task/vscode-task) 中进行维护。 我们希望从社区收集反馈,请尝试并通过[discussion](https://github.com/go-task/vscode-task/discussions)、 [issue](https://github.com/go-task/vscode-task/issues) 或 [Discord](https://discord.gg/6TY36E39UK) 告诉我们您的想法!
> **注意:** 扩展 _需要安装_ v3.23.0 才能正常工作。

View File

@ -35,7 +35,7 @@ sudo snap install task --classic
### Chocolatey
如果 Windows 上安装了 [Chocolatey](https://chocolatey.org/),再安装 Task 只要这样:
如果 Windows 上安装了 [Chocolatey][choco],再安装 Task 只要这样:
```bash
choco install go-task
@ -45,7 +45,7 @@ choco install go-task
### Scoop
如果 Windows 上安装了 [Scoop](https://scoop.sh/),再安装 Task 只要这样:
如果 Windows 上安装了 [Scoop][scoop],再安装 Task 只要这样:
```cmd
scoop install task
@ -97,6 +97,14 @@ nix-env -iA nixpkgs.go-task
npm install -g @go-task/cli
```
### Winget
如果您正在使用 Windows 并且安装了 [winget](https://github.com/microsoft/winget-cli) 软件包管理工具,您可以从 [winget-pkgs](https://github.com/microsoft/winget-pkgs) 安装 Task。
```bash
winget install Task.Task
```
## 获取二进制文件
### 二进制文件
@ -125,12 +133,10 @@ sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
:::caution
在 macOS 和 Windows 上,`~/.local/bin``~/bin` 默认情况下不会添加到 `$PATH`
:::
### GitHub Actions
如果你想在 GitHub Actions 中安装 Task,你可以尝试使用 Arduino 团队的 [这个 action](https://github.com/arduino/setup-task):
@ -138,6 +144,9 @@ sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
```yaml
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
这种安装方式是社区维护的。
@ -162,12 +171,10 @@ env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
:::tip
对于 CI 环境,我们建议改用 [安装脚本](#get-the-binary),它更快更稳定,因为它只会下载最新发布的二进制文件。
对于 CI 环境,我们建议改用 [安装脚本](#安装脚本),它更快更稳定,因为它只会下载最新发布的二进制文件。
:::
## 自动完成
下载与您的 shell 对应的自动完成文件。
@ -229,3 +236,6 @@ notepad $profile
```shell
Invoke-Expression -Command path/to/task.ps1
```
[choco]: https://chocolatey.org/
[scoop]: https://scoop.sh/

View File

@ -14,7 +14,7 @@ Task 是一个任务运行器/构建工具,旨在比 [GNU Make](https://www.gn
由于它是用 [Go](https://go.dev/) 编写的,Task 只是一个二进制文件,没有其他依赖项,这意味着您不需要为了使用构建工具而烦恼任何复杂的安装设置。
[安装](installation.md) 后,您只需在名为 `Taskfile.yml` 的文件中使用简单的 [YAML](http://yaml.org/) 规则描述您的构建任务:
[安装](installation.md) 后,您只需在名为 `Taskfile.yml` 的文件中使用简单的 [YAML][yaml] 规则描述您的构建任务:
```yaml title="Taskfile.yml"
version: '3'
@ -46,3 +46,4 @@ tasks:
| [![Appwrite](/img/appwrite.svg)](https://appwrite.io/?utm_source=taskfile.dev&utm_medium=website&utm_campaign=task_oss_fund) |
</div>
[yaml]: http://yaml.org/

View File

@ -89,7 +89,7 @@ tasks:
## 版本 2.1
2.1 版包括一个全局 `output` 选项,以允许更好地控制如何将命令输出打印到控制台(有关更多信息,请参阅 [文档](usage.md#输出语法)):
2.1 版包括一个全局 `output` 选项,以允许更好地控制如何将命令输出打印到控制台(有关更多信息,请参阅 [文档][output]):
```yaml
version: '2'
@ -103,7 +103,7 @@ tasks:
prefix: server
```
从这个版本开始,也可以忽略命令或 task 的错误(在 [此处](usage.md#忽略错误) 查看文档):
从这个版本开始,也可以忽略命令或 task 的错误(在 [此处][ignore_errors] 查看文档):
```yaml
version: '2'
@ -149,7 +149,7 @@ tasks:
- aws s3 cp .env s3://myenvironment
```
请检查 [文档](usage.md#包含其他-taskfile)
请检查 [文档][includes]
## 版本 3
@ -202,3 +202,7 @@ tasks:
- 全局或 CLI 变量
- 调用变量
- Task 内的变量
[output]: usage.md#输出语法
[ignore_errors]: usage.md#忽略错误
[includes]: usage.md#包含其他-taskfile

View File

@ -7,6 +7,9 @@ sidebar_position: 13
想帮助我们翻译此文档吗? 在本文档中,我们解释了如何解决这一问题。
不要直接在 GitHub 存储库上编辑翻译后的 markdown 文件! 我们使用 [Crowdin](https://crowdin.com/project/taskfile) 来允许贡献者进行翻译工作。 存储库会根据 Crowdin 的进展定期更新。
不要直接在 GitHub 存储库上编辑翻译后的 markdown 文件! 我们使用 [Crowdin][crowdin] 来允许贡献者进行翻译工作。 存储库会根据 Crowdin 的进展定期更新。
如果您想访问 Crowdin 项目以提供翻译建议,请在 [我们的 Discord 服务器上的 #translations 频道](https://discord.gg/6TY36E39UK) 上申请访问权限。 如果给定的语言尚未显示给 Crowdin,请询问,我们可以对其进行配置。
如果您想访问 Crowdin 项目以提供翻译建议,请在 [我们的 Discord 服务器上的 #translations 频道][discord] 上申请访问权限。 如果给定的语言尚未显示给 Crowdin,请询问,我们可以对其进行配置。
[crowdin]: https://crowdin.com/project/taskfile
[discord]: https://discord.gg/6TY36E39UK

View File

@ -65,13 +65,12 @@ tasks:
### 运行全局 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.
如果您使用 `--global`(别名 `-g`)标志调用 Task,它将查找您的 home 目录而不是您的工作目录。 简而言之,Task 将在 `$HOME/Taskfile.yml``$HOME/Taskfile.yaml` 路径上寻找 Taskfile。
这对于您可以在系统的任何地方运行的自动化很有用!
:::info
When running your global Taskfile with `-g`, tasks will run on `$HOME` by default, and not on your working directory!
As mentioned in the previous section, the `{{.USER_WORKING_DIR}}` special variable can be very handy here to run stuff on the directory you're calling `task -g` from.
@ -92,7 +91,6 @@ tasks:
:::
## 环境变量
### Task
@ -126,12 +124,10 @@ tasks:
:::info
`env` 支持扩展和检索 shell 命令的输出,就像变量一样,如您在 [变量](#变量) 部分中看到的那样。
:::
### .env 文件
您还可以使用 `dotenv:` 设置要求 tasks 包含 `.env` 之类的文件
@ -192,12 +188,10 @@ tasks:
:::info
请注意,您目前无法在包含的 Taskfile 中使用 `dotenv` 键。
:::
## 包含其他 Taskfile
如果要在不同项目(Taskfile)之间共享任务,可以使用导入机制使用 `includes` 关键字包含其他任务文件:
@ -240,12 +234,10 @@ includes:
:::info
包含的 Taskfile 必须使用与主 Taskfile 使用的相同规则版本。
:::
### 可选 includes
如果包含文件丢失,标记为可选的包含将允许 task 继续正常执行。
@ -298,7 +290,7 @@ includes:
### 命名空间别名
When including a Taskfile, you can give the namespace a list of `aliases`. This works in the same way as [task aliases](#task-aliases) and can be used together to create shorter and easier-to-type commands.
包含 Taskfile 时,您可以为命名空间提供一个 `aliases` 列表。 这与 [task 别名](#task-别名) 的工作方式相同,可以一起使用来创建更短且更易于键入的命令。
```yaml
version: '3'
@ -311,12 +303,10 @@ includes:
:::info
Vars declared in the included Taskfile have preference over the variables in the including Taskfile! If you want a variable in an included Taskfile to be overridable, use the [default function](https://go-task.github.io/slim-sprig/defaults.html): `MY_VAR: '{{.MY_VAR | default "my-default-value"}}'`.
:::
## 内部 tasks
Internal tasks are tasks that cannot be called directly by the user. They will not appear in the output when running `task --list|--list-all`. Other tasks may call internal tasks in the usual way. This is useful for creating reusable, function-like tasks that have no useful purpose on the command line.
@ -339,7 +329,7 @@ tasks:
## Task 目录
By default, tasks will be executed in the directory where the Taskfile is located. But you can easily make the task run in another folder, informing `dir`:
默认情况下,tasks 将在 Taskfile 所在的目录中执行。 但是您可以轻松地让 task 在另一个目录中运行,指定 `dir`
```yaml
version: '3'
@ -356,9 +346,9 @@ tasks:
## Task 依赖
> Dependencies run in parallel, so dependencies of a task should not depend one another. If you want to force tasks to run serially, take a look at the [Calling Another Task](#calling-another-task) section below.
> 依赖项并行运行,因此一项 task 的依赖项不应相互依赖。 如果您想强制任务顺序运行,请查看下面的 [调用另一个 task](#调用另一个-task) 部分。
You may have tasks that depend on others. Just pointing them on `deps` will make them run automatically before running the parent task:
您可能有依赖于其它的 task。 将它们指向 `deps` 将使它们在运行父 task 之前自动运行:
```yaml
version: '3'
@ -374,9 +364,9 @@ tasks:
- esbuild --bundle --minify css/index.css > public/bundle.css
```
In the above example, `assets` will always run right before `build` if you run `task build`.
在上面的示例中,如果您运行 `task build``assets` 将始终在 `build` 之前运行。
一个任务只能有依赖关系,没有命令来将任务组合在一起:
一个 task 只能有依赖关系,没有命令来将 task 组合在一起:
```yaml
version: '3'
@ -398,13 +388,11 @@ tasks:
:::tip
You can also make the tasks given by the command line run in parallel by using the `--parallel` flag (alias `-p`). Example: `task --parallel js css`.
您还可以使用 `--parallel` 标志(别名 `-p`)使命令行给出的 task 并行运行。 例如: `task --parallel js css`
:::
如果你想将信息传递给依赖项,你可以像 [调用另一个任务](#调用另一个-task) 一样以相同的方式进行:
如果你想将信息传递给依赖项,你可以像 [调用另一个 task](#调用另一个-task) 一样以相同的方式进行:
```yaml
version: '3'
@ -426,11 +414,11 @@ tasks:
## 平台特定的 tasks 和 cmds
If you want to restrict the running of tasks to explicit platforms, this can be achieved using the `platforms:` key. Tasks can be restricted to a specific OS, architecture or a combination of both. On a mismatch, the task or command will be skipped, and no error will be thrown.
如果您想将 task 的运行限制在明确的平台上,可以使用 `platforms:` 键来实现。 Task 可以限制在特定的操作系统、架构或两者的组合中。 如果不匹配,任务或命令将被跳过,并且不会抛出任何错误。
The values allowed as OS or Arch are valid `GOOS` and `GOARCH` values, as defined by the Go language [here](https://github.com/golang/go/blob/master/src/go/build/syslist.go).
允许作为 OS 或 Arch 的值是有效的 `GOOS``GOARCH` 值,正如 [此处](https://github.com/golang/go/blob/master/src/go/build/syslist.go) 的 Go 语言所定义的那样。
The `build-windows` task below will run only on Windows, and on any architecture:
下面的 `build-windows` task 将仅在 Windows 所有架构上运行:
```yaml
version: '3'
@ -442,7 +430,7 @@ tasks:
- echo 'Running command on Windows'
```
This can be restricted to a specific architecture as follows:
这可以限制为特定的架构,如下所示:
```yaml
version: '3'
@ -454,7 +442,7 @@ tasks:
- echo 'Running command on Windows (amd64)'
```
It is also possible to restrict the task to specific architectures:
也可以将 task 限制在特定的架构中:
```yaml
version: '3'
@ -466,7 +454,7 @@ tasks:
- echo 'Running command on amd64'
```
Multiple platforms can be specified as follows:
可以指定多个平台,如下所示:
```yaml
version: '3'
@ -478,7 +466,7 @@ tasks:
- echo 'Running command on Windows (amd64) and macOS'
```
Individual commands can also be restricted to specific platforms:
个别命令也可以限制在特定平台上:
```yaml
version: '3'
@ -536,12 +524,10 @@ tasks:
:::tip
NOTE: If you want to call a task declared in the root Taskfile from within an [included Taskfile](#including-other-taskfiles), add a leading `:` like this: `task: :task-name`.
注意:如果您想从 [包含的 Taskfile](#包含其他-taskfile) 中调用在根 Taskfile 中声明的 task,请像这样添加 `:` 前缀:`task: :task-name`
:::
## 减少不必要的工作
### 通过指纹识别本地生成的文件及其来源
@ -576,7 +562,7 @@ tasks:
`sources` and `generates` can be files or file patterns. When given, Task will compare the checksum of the source files to determine if it's necessary to run the task. If not, it will just print a message like `Task "js" is up to date`.
If you prefer this check to be made by the modification timestamp of the files, instead of its checksum (content), just set the `method` property to `timestamp`.
如果您希望通过文件的修改 timestamp 而不是其 checksum(内容)来进行此检查,只需将 `method` 属性设置为 `timestamp` 即可。
```yaml
version: '3'
@ -592,11 +578,10 @@ tasks:
method: timestamp
```
In situations where you need more flexibility the `status` keyword can be used. You can even combine the two. See the documentation for [status](#using-programmatic-checks-to-indicate-a-task-is-up-to-date) for an example.
在需要更大灵活性的情况下,可以使用 `status` 关键字。 您甚至可以将两者结合起来。 有关示例,请参阅 [状态](#使用程序检查来表示任务是最新的) 文档。
:::info
By default, task stores checksums on a local `.task` directory in the project's directory. Most of the time, you'll want to have this directory on `.gitignore` (or equivalent) so it isn't committed. (If you have a task for code generation that is committed it may make sense to commit the checksum of that task as well, though).
If you want these files to be stored in another directory, you can set a `TASK_TEMP_DIR` environment variable in your machine. It can contain a relative path like `tmp/task` that will be interpreted as relative to the project directory, or an absolute or home path like `/tmp/.task` or `~/.task` (subdirectories will be created for each project).
@ -607,34 +592,27 @@ export TASK_TEMP_DIR='~/.task'
:::
:::info
Each task has only one checksum stored for its `sources`. If you want to distinguish a task by any of its input variables, you can add those variables as part of the task's label, and it will be considered a different task.
This is useful if you want to run a task once for each distinct set of inputs until the sources actually change. For example, if the sources depend on the value of a variable, or you if you want the task to rerun if some arguments change even if the source has not.
:::
:::tip
The method `none` skips any validation and always run the task.
将 method 设置为 `none` 会跳过任何验证并始终运行任务。
:::
:::info
For the `checksum` (default) or `timestamp` method to work, it is only necessary to inform the source files. When the `timestamp` method is used, the last time of the running the task is considered as a generate.
:::
### 使用程序检查来表示任务是最新的。
### 使用程序检查来表示任务是最新的
Alternatively, you can inform a sequence of tests as `status`. If no error is returned (exit status 0), the task is considered up-to-date:
@ -662,7 +640,7 @@ Note that the `{{.TIMESTAMP}}` variable is a "live" Go `time.Time` struct, and c
有关详细信息,请参阅 [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.
如果你想强制任务运行,即使是最新的,你也可以使用 `--force``-f`
Also, `task --status [tasks]...` will exit with a non-zero exit code if any of the tasks are not up-to-date.
@ -736,7 +714,7 @@ tasks:
If a task executed by multiple `cmds` or multiple `deps` you can control when it is executed using `run`. `run` can also be set at the root of the Taskfile to change the behavior of all the tasks unless explicitly overridden.
Supported values for `run`:
`run` 支持的值:
* `always` (default) always attempt to invoke the task regardless of the number of previous executions
* `once` only invoke this task once regardless of the number of references
@ -770,7 +748,7 @@ tasks:
## 变量
When doing interpolation of variables, Task will look for the below. They are listed below in order of importance (i.e. most important first):
在进行变量插值时,Task 将查找以下内容。 它们按权重顺序列在下面(即最重要的第一位):
- Variables declared in the task definition
- Variables given while calling a task from another (See [Calling another task](#calling-another-task) above)
@ -779,7 +757,7 @@ When doing interpolation of variables, Task will look for the below. They are li
- Global variables (those declared in the `vars:` option in the Taskfile)
- Environment variables
Example of sending parameters with environment variables:
使用环境变量传输参数的示例:
```bash
$ TASK_VARIABLE=a-value task do-something
@ -787,12 +765,10 @@ $ TASK_VARIABLE=a-value task do-something
:::tip
A special variable `.TASK` is always available containing the task name.
:::
Since some shells do not support the above syntax to set environment variables (Windows) tasks also accept a similar style when not at the beginning of the command.
```bash
@ -897,17 +873,15 @@ tasks:
:::info
Due to the nature of how the [Go's own `defer` work](https://go.dev/tour/flowcontrol/13), the deferred commands are executed in the reverse order if you schedule multiple of them.
:::
## Go 的模板引擎
Task parse commands as [Go's template engine](https://golang.org/pkg/text/template/) before executing them. Variables are accessible through dot syntax (`.VARNAME`).
任务在执行命令之前将命令解析为 [Go 的模板引擎][gotemplate]。 可以通过点语法 (`.VARNAME`) 访问变量。
All functions by the Go's [slim-sprig lib](https://go-task.github.io/slim-sprig/) are available. The following example gets the current date in a given format:
Go 的 [slim-sprig 库](https://go-task.github.io/slim-sprig/) 的所有功能都可用。 以下示例按照给定格式获取当前日期:
```yaml
version: '3'
@ -918,7 +892,7 @@ tasks:
- echo {{now | date "2006-01-02"}}
```
Task also adds the following functions:
Task 还增加了以下功能:
- `OS`: Returns the operating system. Possible values are "windows", "linux", "darwin" (macOS) and "freebsd".
- `ARCH`: return the architecture Task was compiled to: "386", "amd64", "arm" or "s390x".
@ -957,7 +931,7 @@ tasks:
## 帮助
Running `task --list` (or `task -l`) lists all tasks with a description. The following Taskfile:
运行 `task --list`(或 `task -l`)列出所有带有描述的任务。 以下 Taskfile:
```yaml
version: '3'
@ -982,18 +956,18 @@ tasks:
- esbuild --bundle --minify css/index.css > public/bundle.css
```
would print the following output:
将打印以下输出:
```bash
* build: Build the go binary.
* test: Run all the go tests.
```
If you want to see all tasks, there's a `--list-all` (alias `-a`) flag as well.
如果您想查看所有任务,还有一个 `--list-all`(别名 `-a`)标志。
## 显示任务摘要
Running `task --summary task-name` will show a summary of a task. The following Taskfile:
运行 `task --summary task-name` 将显示任务的摘要。 以下 Taskfile:
```yaml
version: '3'
@ -1002,10 +976,10 @@ tasks:
release:
deps: [build]
summary: |
Release your project to github
发布你的项目到 github
It will build your project before starting the release.
Please make sure that you have set GITHUB_TOKEN before starting.
它将在开始发布之前构建您的项目。
请确保您在开始之前已经设置了 GITHUB_TOKEN。
cmds:
- your-release-tool
@ -1014,15 +988,15 @@ tasks:
- your-build-tool
```
with running `task --summary release` would print the following output:
运行 `task --summary release` 将打印以下输出:
```
task: release
Release your project to github
发布你的项目到 github
It will build your project before starting the release.
Please make sure that you have set GITHUB_TOKEN before starting.
它将在开始发布之前构建您的项目。
请确保您在开始之前已经设置了 GITHUB_TOKEN。
dependencies:
- build
@ -1030,13 +1004,13 @@ dependencies:
commands:
- your-release-tool
```
If a summary is missing, the description will be printed. If the task does not have a summary or a description, a warning is printed.
如果缺少摘要,将打印描述。 如果任务没有摘要或描述,则会打印一条警告。
Please note: *showing the summary will not execute the command*.
请注意:*显示摘要不会执行命令*。
## Task 别名
Aliases are alternative names for tasks. They can be used to make it easier and quicker to run tasks with long or hard-to-type names. You can use them on the command line, when [calling sub-tasks](#calling-another-task) in your Taskfile and when [including tasks](#including-other-taskfiles) with aliases from another Taskfile. They can also be used together with [namespace aliases](#namespace-aliases).
Aliases 是 task 的替代名称。 它们可以使运行具有长名称或难以键入名称的 task 变得更加容易和快速。 您可以在命令行上使用它们,在您的 Taskfile 中 [调用子任务](#调用另一个-task) 时以及在 [包含来自另一个 Taskfile](#包含其他-taskfile) 的别名 task 时。 它们也可以与 [命名空间别名](#命名空间别名) 一起使用。
```yaml
version: '3'
@ -1053,7 +1027,7 @@ tasks:
- echo "generating..."
```
## 重写 Task 名称
## 覆盖 Task 名称
Sometimes you may want to override the task name printed on the summary, up-to-date messages to STDOUT, etc. In this case, you can just set `label:`, which can also be interpolated with variables:
@ -1077,7 +1051,7 @@ tasks:
## 静默模式
Silent mode disables the echoing of commands before Task runs it. For the following Taskfile:
静默模式在 Task 运行命令之前禁用命令回显。 对于以下 Taskfile:
```yaml
version: '3'
@ -1088,22 +1062,22 @@ tasks:
- echo "Print something"
```
Normally this will be printed:
通常这将打印:
```sh
echo "Print something"
Print something
```
With silent mode on, the below will be printed instead:
开启静默模式后,将打印以下内容:
```sh
Print something
```
There are four ways to enable silent mode:
开启静默模式有四种方式:
* At command level:
* 在 cmds 级别:
```yaml
version: '3'
@ -1115,7 +1089,7 @@ tasks:
silent: true
```
* At task level:
* 在 task 级别:
```yaml
version: '3'
@ -1127,7 +1101,7 @@ tasks:
silent: true
```
* Globally at Taskfile level:
* 在 Taskfile 全局级别:
```yaml
version: '3'
@ -1140,9 +1114,9 @@ tasks:
- echo "Print something"
```
* Or globally with `--silent` or `-s` flag
* 或者全局使用 `--silent``-s` 标志
If you want to suppress STDOUT instead, just redirect a command to `/dev/null`:
如果您想改为禁止 STDOUT,只需将命令重定向到 `/dev/null`
```yaml
version: '3'
@ -1159,7 +1133,7 @@ Dry run mode (`--dry`) compiles and steps through each task, printing the comman
## 忽略错误
You have the option to ignore errors during command execution. Given the following Taskfile:
您可以选择在命令执行期间忽略错误。 给定以下 Taskfile:
```yaml
version: '3'
@ -1190,13 +1164,13 @@ tasks:
By default, Task just redirects the STDOUT and STDERR of the running commands to the shell in real-time. This is good for having live feedback for logging printed by commands, but the output can become messy if you have multiple commands running simultaneously and printing lots of stuff.
To make this more customizable, there are currently three different output options you can choose:
为了使其更具可定制性,目前您可以选择三种不同的输出选项:
- `interleaved` (default)
- `interleaved` (默认)
- `group`
- `prefixed`
To choose another one, just set it to root in the Taskfile:
要选择另一个,只需在 Taskfile 根目录中设置即可:
```yaml
version: '3'
@ -1207,7 +1181,7 @@ tasks:
# ...
```
The `group` output will print the entire output of a command once after it finishes, so you will not have live feedback for commands that take a long time to run.
`group` 输出将在命令完成后打印一次命令的全部输出,因此您不会对需要很长时间运行的命令有实时反馈。
When using the `group` output, you can optionally provide a templated message to print at the start and end of the group. This can be useful for instructing CI systems to group all of the output for a given task, such as with [GitHub Actions' `::group::` command](https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#grouping-log-lines) or [Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?expand=1&view=azure-devops&tabs=bash#formatting-commands).
@ -1289,12 +1263,10 @@ $ task default
:::tip
The `output` option can also be specified by the `--output` or `-o` flags.
:::
## 交互式 CLI 应用
When running interactive CLI applications inside Task they can sometimes behave weirdly, especially when the [output mode](#output-syntax) is set to something other than `interleaved` (the default), or when interactive apps are run in parallel with other tasks.
@ -1345,14 +1317,14 @@ tasks:
:::info
Keep in mind that not all options are available in the [shell interpreter library](https://github.com/mvdan/sh) that Task uses.
:::
## 观察任务
With the flags `--watch` or `-w` task will watch for file changes and run the task again. This requires the `sources` attribute to be given, so task knows which files to watch.
The default watch interval is 5 seconds, but it's possible to change it by either setting `interval: '500ms'` in the root of the Taskfile passing it as an argument like `--interval=500ms`.
[gotemplate]: https://golang.org/pkg/text/template/