mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
apply prettier
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { VPBadge } from 'vitepress/theme'
|
||||
import { VPBadge } from 'vitepress/theme';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VPBadge type="info">
|
||||
<slot />+
|
||||
</VPBadge>
|
||||
<VPBadge type="info"> <slot />+ </VPBadge>
|
||||
</template>
|
||||
|
@@ -1,32 +1,29 @@
|
||||
:root {
|
||||
--ifm-color-primary: #43ABA2 ;
|
||||
--ifm-color-primary: #43aba2;
|
||||
--vp-home-hero-name-color: var(--ifm-color-primary);
|
||||
--vp-c-brand-1: var(--ifm-color-primary);
|
||||
--vp-c-brand-2: var(--ifm-color-primary);
|
||||
--vp-c-brand-3: var(--ifm-color-primary);
|
||||
}
|
||||
|
||||
img[src*="shields.io"] {
|
||||
img[src*='shields.io'] {
|
||||
display: inline;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
img[src*="custom-icon-badges.demolab.com"] {
|
||||
img[src*='custom-icon-badges.demolab.com'] {
|
||||
display: inline;
|
||||
height: 1em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.github-user-mention {
|
||||
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
|
||||
.github-user-mention {
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
|
||||
.vp-doc .blog-post:first-of-type {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
|
||||
.blog-post {
|
||||
animation: fadeInUp 0.6s ease-out;
|
||||
}
|
||||
@@ -42,6 +39,12 @@ img[src*="custom-icon-badges.demolab.com"] {
|
||||
}
|
||||
}
|
||||
|
||||
.blog-post:nth-of-type(1) { animation-delay: 0.1s; }
|
||||
.blog-post:nth-of-type(2) { animation-delay: 0.2s; }
|
||||
.blog-post:nth-of-type(3) { animation-delay: 0.3s; }
|
||||
.blog-post:nth-of-type(1) {
|
||||
animation-delay: 0.1s;
|
||||
}
|
||||
.blog-post:nth-of-type(2) {
|
||||
animation-delay: 0.2s;
|
||||
}
|
||||
.blog-post:nth-of-type(3) {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
version: "3"
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
install:
|
||||
@@ -51,4 +51,3 @@ tasks:
|
||||
desc: Build and deploy Website to Netlify
|
||||
cmds:
|
||||
- pnpm netlify deploy --prod --site=054cd897-66d2-46fa-9b57-4831a8d61b37
|
||||
|
||||
|
@@ -9,15 +9,23 @@ outline: deep
|
||||
|
||||
<AuthorCard :author="$frontmatter.author" />
|
||||
|
||||
Task has always had variables, but even though you were able to define them using different YAML types, they would always be converted to strings by Task. This limited users to string manipulation and encouraged messy workarounds for simple problems. Starting from [v3.37.0][v3.37.0], this is no longer the case! Task now supports most variable types, including **booleans**, **integers**, **floats** and **arrays**!
|
||||
Task has always had variables, but even though you were able to define them
|
||||
using different YAML types, they would always be converted to strings by Task.
|
||||
This limited users to string manipulation and encouraged messy workarounds for
|
||||
simple problems. Starting from [v3.37.0][v3.37.0], this is no longer the case!
|
||||
Task now supports most variable types, including **booleans**, **integers**,
|
||||
**floats** and **arrays**!
|
||||
|
||||
## What's the big deal?
|
||||
|
||||
These changes allow you to use variables in a much more natural way and opens up a wide variety of sprig functions that were previously useless. Take a look at some of the examples below for some inspiration.
|
||||
These changes allow you to use variables in a much more natural way and opens up
|
||||
a wide variety of sprig functions that were previously useless. Take a look at
|
||||
some of the examples below for some inspiration.
|
||||
|
||||
### Evaluating booleans
|
||||
|
||||
No more comparing strings to "true" or "false". Now you can use actual boolean values in your templates:
|
||||
No more comparing strings to "true" or "false". Now you can use actual boolean
|
||||
values in your templates:
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -61,7 +69,9 @@ tasks:
|
||||
- 'echo {{add .INT .FLOAT}}'
|
||||
```
|
||||
|
||||
You can use any of the following arithmetic functions: `add`, `sub`, `mul`, `div`, `mod`, `max`, `min`, `floor`, `ceil`, `round` and `randInt`. Check out the [slim-sprig math documentation][slim-sprig-math] for more information.
|
||||
You can use any of the following arithmetic functions: `add`, `sub`, `mul`,
|
||||
`div`, `mod`, `max`, `min`, `floor`, `ceil`, `round` and `randInt`. Check out
|
||||
the [slim-sprig math documentation][slim-sprig-math] for more information.
|
||||
|
||||
### Arrays
|
||||
|
||||
@@ -78,11 +88,18 @@ tasks:
|
||||
- 'echo {{range .ARRAY}}{{.}}{{end}}'
|
||||
```
|
||||
|
||||
You can use any of the following list-based functions: `first`, `rest`, `last`, `initial`, `append`, `prepend`, `concat`, `reverse`, `uniq`, `without`, `has`, `compact`, `slice` and `chunk`. Check out the [slim-sprig lists documentation][slim-sprig-list] for more information.
|
||||
You can use any of the following list-based functions: `first`, `rest`, `last`,
|
||||
`initial`, `append`, `prepend`, `concat`, `reverse`, `uniq`, `without`, `has`,
|
||||
`compact`, `slice` and `chunk`. Check out the [slim-sprig lists
|
||||
documentation][slim-sprig-list] for more information.
|
||||
|
||||
### Looping over variables using `for`
|
||||
|
||||
Previously, you would have to use a delimiter separated string to loop over an arbitrary list of items in a variable and split them by using the `split` subkey to specify the delimiter. However, we have now added support for looping over "collection-type" variables using the `for` keyword, so now you are able to loop over list variables directly:
|
||||
Previously, you would have to use a delimiter separated string to loop over an
|
||||
arbitrary list of items in a variable and split them by using the `split` subkey
|
||||
to specify the delimiter. However, we have now added support for looping over
|
||||
"collection-type" variables using the `for` keyword, so now you are able to loop
|
||||
over list variables directly:
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -117,10 +134,14 @@ tasks:
|
||||
|
||||
## What about maps?
|
||||
|
||||
Maps were originally included in the Any Variables experiment. However, they weren't quite ready yet. Instead of making you wait for everything to be ready at once, we have released support for all other variable types and we will continue working on map support in the new "[Map Variables][map-variables]" experiment.
|
||||
Maps were originally included in the Any Variables experiment. However, they
|
||||
weren't quite ready yet. Instead of making you wait for everything to be ready
|
||||
at once, we have released support for all other variable types and we will
|
||||
continue working on map support in the new "[Map Variables][map-variables]"
|
||||
experiment.
|
||||
|
||||
|
||||
We're looking for feedback on a couple of different proposals, so please give them a go and let us know what you think. :pray:
|
||||
We're looking for feedback on a couple of different proposals, so please give
|
||||
them a go and let us know what you think. :pray:
|
||||
|
||||
[v3.37.0]: https://github.com/go-task/task/releases/tag/v3.37.0
|
||||
[slim-sprig-math]: https://go-task.github.io/slim-sprig/math.html
|
||||
|
@@ -20,6 +20,3 @@ author="pd93"
|
||||
description="A look at where Task is, where it's going and how we're going to get there. Lately, Task has been growing extremely quickly and I've found myself thinking a lot about the future of the project and how we continue to evolve and grow. I'm not much of a writer, but I think one of the things we could do better is to communicate these kinds of thoughts to the community."
|
||||
:tags="['roadmap', 'experiments', 'community']"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Introducing Experiments
|
||||
description: A look at where task is, where it's going and how we're going to get there.
|
||||
description:
|
||||
A look at where task is, where it's going and how we're going to get there.
|
||||
author: pd93
|
||||
date: 2024-05-09
|
||||
outline: deep
|
||||
@@ -10,62 +11,115 @@ outline: deep
|
||||
|
||||
<AuthorCard :author="$frontmatter.author" />
|
||||
|
||||
Lately, Task has been growing extremely quickly and I've found myself thinking a lot about the future of the project and how we continue to evolve and grow. I'm not much of a writer, but I think one of the things we could do better is to communicate these kinds of thoughts to the community. So, with that in mind, this is the first (hopefully of many) blog posts talking about Task and what we're up to.
|
||||
Lately, Task has been growing extremely quickly and I've found myself thinking a
|
||||
lot about the future of the project and how we continue to evolve and grow. I'm
|
||||
not much of a writer, but I think one of the things we could do better is to
|
||||
communicate these kinds of thoughts to the community. So, with that in mind,
|
||||
this is the first (hopefully of many) blog posts talking about Task and what
|
||||
we're up to.
|
||||
|
||||
## :calendar: So, what have we been up to?
|
||||
|
||||
Over the past 12 months or so, @andreynering (Author and maintainer of the project) and I (@pd93) have been working in our spare time to maintain and improve v3 of Task and we've made some amazing progress. Here are just some of the things we've released in that time:
|
||||
Over the past 12 months or so, @andreynering (Author and maintainer of the
|
||||
project) and I (@pd93) have been working in our spare time to maintain and
|
||||
improve v3 of Task and we've made some amazing progress. Here are just some of
|
||||
the things we've released in that time:
|
||||
|
||||
- An official [extension for VS Code][vscode-task].
|
||||
- Internal Tasks (#818).
|
||||
- Task aliases (#879).
|
||||
- Looping over tasks (#1220).
|
||||
- A series of refactors to the core codebase to make it more maintainable and extensible.
|
||||
- A series of refactors to the core codebase to make it more maintainable and
|
||||
extensible.
|
||||
- Loads of bug fixes and improvements.
|
||||
- An integration with [Crowdin][crowdin]. Work is in progress on making our docs available in **7 new languages** (Special thanks to all our translators for the huge help with this!).
|
||||
- An integration with [Crowdin][crowdin]. Work is in progress on making our docs
|
||||
available in **7 new languages** (Special thanks to all our translators for
|
||||
the huge help with this!).
|
||||
- And much, much more! :sparkles:
|
||||
|
||||
We're also working on adding some really exciting and highly requested features to Task such as having the ability to run remote Taskfiles (#1317).
|
||||
We're also working on adding some really exciting and highly requested features
|
||||
to Task such as having the ability to run remote Taskfiles (#1317).
|
||||
|
||||
None of this would have been possible without the [150 or so (and growing) contributors][contributors] to the project, numerous sponsors and a passionate community of users. Together we have more than doubled the number of GitHub stars to over 8400 :star: since the beginning of 2022 and this continues to accelerate. We can't thank you all enough for your help and support! 🚀
|
||||
None of this would have been possible without the [150 or so (and growing)
|
||||
contributors][contributors] to the project, numerous sponsors and a passionate
|
||||
community of users. Together we have more than doubled the number of GitHub
|
||||
stars to over 8400 :star: since the beginning of 2022 and this continues to
|
||||
accelerate. We can't thank you all enough for your help and support! 🚀
|
||||
|
||||
[](https://star-history.com/#go-task/task&Date)
|
||||
|
||||
## What's next? :thinking:
|
||||
|
||||
It's extremely motivating to see so many people using and loving Task. However, in this time we've also seen an increase in the number of issues and feature requests. In particular, issues that require some kind of breaking change to Task. This isn't a bad thing, but as we grow we need to be more responsible about how we address these changes in a way that ensures stability and compatibility for existing users and their Taskfiles.
|
||||
It's extremely motivating to see so many people using and loving Task. However,
|
||||
in this time we've also seen an increase in the number of issues and feature
|
||||
requests. In particular, issues that require some kind of breaking change to
|
||||
Task. This isn't a bad thing, but as we grow we need to be more responsible
|
||||
about how we address these changes in a way that ensures stability and
|
||||
compatibility for existing users and their Taskfiles.
|
||||
|
||||
At this point you're probably thinking something like:
|
||||
|
||||
> "But you use [semantic versioning][semver] - Just release a new major version with your breaking changes."
|
||||
> "But you use [semantic versioning][semver] - Just release a new major version
|
||||
> with your breaking changes."
|
||||
|
||||
And you'd be right... sort of. In theory, this sounds great, but the reality is that we don't have the time to commit to a major overhaul of Task in one big bang release. This would require a colossal amount of time and coordination and with full time jobs and personal lives to tend to, this is a difficult commitment to make. Smaller, more frequent major releases are also a significant inconvenience for users as they have to constantly keep up-to-date with our breaking changes. Fortunately, there is a better way.
|
||||
And you'd be right... sort of. In theory, this sounds great, but the reality is
|
||||
that we don't have the time to commit to a major overhaul of Task in one big
|
||||
bang release. This would require a colossal amount of time and coordination and
|
||||
with full time jobs and personal lives to tend to, this is a difficult
|
||||
commitment to make. Smaller, more frequent major releases are also a significant
|
||||
inconvenience for users as they have to constantly keep up-to-date with our
|
||||
breaking changes. Fortunately, there is a better way.
|
||||
|
||||
## What's going to change? :monocle_face:
|
||||
|
||||
Going forwards, breaking changes will be allowed into _minor_ versions of Task as "experimental features". To access these features users will need opt-in by enabling feature flags. This will allow us to release new features slowly and gather feedback from the community before making them the default behavior in a future major release.
|
||||
Going forwards, breaking changes will be allowed into _minor_ versions of Task
|
||||
as "experimental features". To access these features users will need opt-in by
|
||||
enabling feature flags. This will allow us to release new features slowly and
|
||||
gather feedback from the community before making them the default behavior in a
|
||||
future major release.
|
||||
|
||||
To prepare users for the next major release, we will maintain a list of [deprecated features][deprecations] and [experiments][experiments] on our docs website and publish information on how to migrate to the new behavior.
|
||||
To prepare users for the next major release, we will maintain a list of
|
||||
[deprecated features][deprecations] and [experiments][experiments] on our docs
|
||||
website and publish information on how to migrate to the new behavior.
|
||||
|
||||
You can read the [full breaking change proposal][breaking-change-proposal] and view all the [current experiments and their status][experiments-project] on GitHub including the [Gentle Force][gentle-force-experiment] and [Remote Taskfiles][remote-taskfiles-experiment] experiments.
|
||||
You can read the [full breaking change proposal][breaking-change-proposal] and
|
||||
view all the [current experiments and their status][experiments-project] on
|
||||
GitHub including the [Gentle Force][gentle-force-experiment] and [Remote
|
||||
Taskfiles][remote-taskfiles-experiment] experiments.
|
||||
|
||||
## What will happen to v2/v3 features?
|
||||
|
||||
v2 has been [officially deprecated][deprecate-version-2-schema]. If you're still using a Taskfile with `version: "2"` at the top we _strongly recommend_ that you upgrade as soon as possible. Removing v2 will allow us to tidy up the codebase and focus on new functionality instead.
|
||||
v2 has been [officially deprecated][deprecate-version-2-schema]. If you're still
|
||||
using a Taskfile with `version: "2"` at the top we _strongly recommend_ that you
|
||||
upgrade as soon as possible. Removing v2 will allow us to tidy up the codebase
|
||||
and focus on new functionality instead.
|
||||
|
||||
When v4 is released, we will continue to support v3 for a period of time (bug fixes etc). However, since we are moving from a backward-compatibility model to a forwards-compatibility model, **v4 itself will not be backwards compatible with v3**.
|
||||
When v4 is released, we will continue to support v3 for a period of time (bug
|
||||
fixes etc). However, since we are moving from a backward-compatibility model to
|
||||
a forwards-compatibility model, **v4 itself will not be backwards compatible
|
||||
with v3**.
|
||||
|
||||
## v4 When? :eyes:
|
||||
|
||||
:man_shrugging: When it's ready.
|
||||
|
||||
In all seriousness, we don't have a timeline for this yet. We'll be working on the most serious deficiencies of the v3 API first and regularly evaluating the state of the project. When we feel its in a good, stable place and we have a clear upgrade path for users and a number of stable experiments, we'll start to think about v4.
|
||||
In all seriousness, we don't have a timeline for this yet. We'll be working on
|
||||
the most serious deficiencies of the v3 API first and regularly evaluating the
|
||||
state of the project. When we feel its in a good, stable place and we have a
|
||||
clear upgrade path for users and a number of stable experiments, we'll start to
|
||||
think about v4.
|
||||
|
||||
## :wave: Final thoughts
|
||||
|
||||
Task is growing fast and we're excited to see where it goes next. We hope that the steps we're taking to improve the project and our process will help us to continue to grow. As always, if you have any questions or feedback, we encourage you to comment on or open [issues][issues] and [discussions][discussions] on GitHub. Alternatively, you can join us on [Discord][discord].
|
||||
Task is growing fast and we're excited to see where it goes next. We hope that
|
||||
the steps we're taking to improve the project and our process will help us to
|
||||
continue to grow. As always, if you have any questions or feedback, we encourage
|
||||
you to comment on or open [issues][issues] and [discussions][discussions] on
|
||||
GitHub. Alternatively, you can join us on [Discord][discord].
|
||||
|
||||
I plan to write more of these blog posts in the future on a variety of Task-related topics, so make sure to check in occasionally and see what we're up to!
|
||||
I plan to write more of these blog posts in the future on a variety of
|
||||
Task-related topics, so make sure to check in occasionally and see what we're up
|
||||
to!
|
||||
|
||||
[vscode-task]: https://github.com/go-task/vscode-task
|
||||
[crowdin]: https://crowdin.com
|
||||
|
@@ -92,8 +92,8 @@ Reverted the changes made in #2113 and #2186 that affected the
|
||||
- The default taskfile (output when using the `--init` flag) is now an embedded
|
||||
file in the binary instead of being stored in the code (#2112 by @pd93).
|
||||
- Improved the way we report the Task version when using the `--version` flag or
|
||||
<span v-pre>`{{.TASK_VERSION}}`</span> variable. This should now be more consistent and easier
|
||||
for package maintainers to use (#2131 by @pd93).
|
||||
<span v-pre>`{{.TASK_VERSION}}`</span> variable. This should now be more
|
||||
consistent and easier for package maintainers to use (#2131 by @pd93).
|
||||
- Fixed a bug where globstar (`**`) matching in `sources` only resolved the
|
||||
first result (#2073, #2075 by @pd93).
|
||||
- Fixed a bug where sorting tasks by "none" would use the default sorting
|
||||
@@ -553,9 +553,10 @@ stabilize the API in the future. #121 now tracks this piece of work.
|
||||
- Fix a missing a line break on log when using `--watch` mode (#1285, #1297 by
|
||||
@FilipSolich).
|
||||
- Fix `defer` on JSON Schema (#1288 by @calvinmclean and @andreynering).
|
||||
- Fix bug in usage of special variables like <span v-pre>`{{.USER_WORKING_DIR}}`</span> in
|
||||
combination with `includes` (#1046, #1205, #1250, #1293, #1312, #1274 by
|
||||
@andarto, #1309 by @andreynering).
|
||||
- Fix bug in usage of special variables like
|
||||
<span v-pre>`{{.USER_WORKING_DIR}}`</span> in combination with `includes`
|
||||
(#1046, #1205, #1250, #1293, #1312, #1274 by @andarto, #1309 by
|
||||
@andreynering).
|
||||
- Fix bug on `--status` flag. Running this flag should not have side-effects: it
|
||||
should not update the checksum on `.task`, only report its status (#1305,
|
||||
#1307 by @visciang, #1313 by @andreynering).
|
||||
@@ -661,9 +662,10 @@ it a go and let us know what you think via a
|
||||
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to
|
||||
`Taskfile.yml` (#1062 by @misitebao).
|
||||
- Added new `splitArgs` template function
|
||||
(<span v-pre>`{{splitArgs "foo bar 'foo bar baz'"}}`</span>) to ensure string is split as
|
||||
arguments (#1040, #1059 by @dhanusaputra).
|
||||
- Fix the value of <span v-pre>`{{.CHECKSUM}}`</span> variable in status (#1076, #1080 by @pd93).
|
||||
(<span v-pre>`{{splitArgs "foo bar 'foo bar baz'"}}`</span>) to ensure string
|
||||
is split as arguments (#1040, #1059 by @dhanusaputra).
|
||||
- Fix the value of <span v-pre>`{{.CHECKSUM}}`</span> variable in status (#1076,
|
||||
#1080 by @pd93).
|
||||
- Fixed deep copy implementation (#1072 by @pd93)
|
||||
- Created a tool to assist with releases (#1086 by @pd93).
|
||||
|
||||
@@ -715,8 +717,8 @@ it a go and let us know what you think via a
|
||||
|
||||
- Small bug fix: closing `Taskfile.yml` once we're done reading it (#963, #964
|
||||
by @HeCorr).
|
||||
- Fixes a bug in v2 that caused a panic when using a <span v-pre>`Taskfile_{{OS}}.yml`</span> file
|
||||
(#961, #971 by @pd93).
|
||||
- Fixes a bug in v2 that caused a panic when using a
|
||||
<span v-pre>`Taskfile_{{OS}}.yml`</span> file (#961, #971 by @pd93).
|
||||
- Fixed a bug where watch intervals set in the Taskfile were not being respected
|
||||
(#969, #970 by @pd93)
|
||||
- Add `--json` flag (alias `-j`) with the intent to improve support for code
|
||||
@@ -734,7 +736,8 @@ it a go and let us know what you think via a
|
||||
- Add task-level `dotenv` support (#389, #904).
|
||||
- It's now possible to use global level variables on `includes` (#942, #943).
|
||||
- The website got a brand new
|
||||
[translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by @DeronW. Thanks!
|
||||
[translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by
|
||||
@DeronW. Thanks!
|
||||
|
||||
## v3.18.0 - 2022-11-12
|
||||
|
||||
@@ -851,11 +854,10 @@ it a go and let us know what you think via a
|
||||
with the `defer:` keyword
|
||||
([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer),
|
||||
#475, #626).
|
||||
- Remove long deprecated and undocumented `---
|
||||
title: Changelog
|
||||
description: Historique complet des versions et changements de Task, de la v3.44.1 jusqu'à la v1.0.0
|
||||
permalink: /changelog/
|
||||
outline: deep
|
||||
- Remove long deprecated and undocumented `--- title: Changelog description:
|
||||
Historique complet des versions et changements de Task, de la v3.44.1 jusqu'à
|
||||
la v1.0.0 permalink: /changelog/ outline: deep
|
||||
|
||||
---
|
||||
|
||||
# Changelog
|
||||
@@ -947,8 +949,8 @@ Reverted the changes made in #2113 and #2186 that affected the
|
||||
- The default taskfile (output when using the `--init` flag) is now an embedded
|
||||
file in the binary instead of being stored in the code (#2112 by @pd93).
|
||||
- Improved the way we report the Task version when using the `--version` flag or
|
||||
<span v-pre>`{{.TASK_VERSION}}`</span> variable. This should now be more consistent and easier
|
||||
for package maintainers to use (#2131 by @pd93).
|
||||
<span v-pre>`{{.TASK_VERSION}}`</span> variable. This should now be more
|
||||
consistent and easier for package maintainers to use (#2131 by @pd93).
|
||||
- Fixed a bug where globstar (`**`) matching in `sources` only resolved the
|
||||
first result (#2073, #2075 by @pd93).
|
||||
- Fixed a bug where sorting tasks by "none" would use the default sorting
|
||||
@@ -1355,8 +1357,7 @@ stabilize the API in the future. #121 now tracks this piece of work.
|
||||
- The
|
||||
[Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles)
|
||||
now prefers remote files over cached ones by default (#1317, #1345 by @pd93).
|
||||
variable prefix and `^` command
|
||||
prefix (#642, #644, #645).
|
||||
variable prefix and `^` command prefix (#642, #644, #645).
|
||||
- Add support for `.yaml` extension (as an alternative to `.yml`). This was
|
||||
requested multiple times throughout the years. Enjoy! (#183, #184, #369, #584,
|
||||
#621).
|
||||
@@ -1374,8 +1375,8 @@ stabilize the API in the future. #121 now tracks this piece of work.
|
||||
|
||||
- Add logging in verbose mode for when a task starts and finishes (#533, #588).
|
||||
- Fix an issue with preconditions and context errors (#597, #598).
|
||||
- Quote each <span v-pre>`{{.CLI_ARGS}}`</span> argument to prevent one with spaces to become many
|
||||
(#613).
|
||||
- Quote each <span v-pre>`{{.CLI_ARGS}}`</span> argument to prevent one with
|
||||
spaces to become many (#613).
|
||||
- Fix nil pointer when `cmd:` was left empty (#612, #614).
|
||||
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant
|
||||
fixes:
|
||||
@@ -1391,8 +1392,8 @@ stabilize the API in the future. #121 now tracks this piece of work.
|
||||
## v3.9.0 - 2021-10-02
|
||||
|
||||
- A new `shellQuote` function was added to the template system
|
||||
(<span v-pre>`{{shellQuote "a string"}}`</span>) to ensure a string is safe for use in shell
|
||||
([mvdan/sh#727](https://github.com/mvdan/sh/pull/727),
|
||||
(<span v-pre>`{{shellQuote "a string"}}`</span>) to ensure a string is safe
|
||||
for use in shell ([mvdan/sh#727](https://github.com/mvdan/sh/pull/727),
|
||||
[mvdan/sh#737](https://github.com/mvdan/sh/pull/737),
|
||||
[Documentation](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote))
|
||||
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Community
|
||||
description: Task community contributions, installation methods, and integrations maintained by third parties
|
||||
description:
|
||||
Task community contributions, installation methods, and integrations
|
||||
maintained by third parties
|
||||
outline: deep
|
||||
---
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Contributing
|
||||
description: Comprehensive guide for contributing to the Task project, including setup, development, testing, and submitting PRs
|
||||
description:
|
||||
Comprehensive guide for contributing to the Task project, including setup,
|
||||
development, testing, and submitting PRs
|
||||
outline: deep
|
||||
---
|
||||
|
||||
@@ -28,9 +30,10 @@ Studio Code][vscode-task].
|
||||
you invest your time into a PR.
|
||||
- **Experiments** - If there is no way to make your change backward compatible
|
||||
then there is a procedure to introduce breaking changes into minor versions.
|
||||
We call these "[experiments](/experiments/)". If you're intending to work on an
|
||||
experiment, then please read the [experiments workflow](/experiments/#workflow)
|
||||
document carefully and submit a proposal first.
|
||||
We call these "[experiments](/experiments/)". If you're intending to work on
|
||||
an experiment, then please read the
|
||||
[experiments workflow](/experiments/#workflow) document carefully and submit a
|
||||
proposal first.
|
||||
|
||||
## 1. Setup
|
||||
|
||||
@@ -50,10 +53,11 @@ Studio Code][vscode-task].
|
||||
docs][golangci-lint-docs] for a guide on how to setup your editor to
|
||||
auto-format your code. Any Markdown or TypeScript files should be formatted
|
||||
and linted by [Prettier][prettier]. This style is enforced by our CI to ensure
|
||||
that we have a consistent style across the project. You can use the `task
|
||||
lint` command to lint the code locally and the `task lint:fix` command to try
|
||||
to automatically fix any issues that are found. You can also use the `task
|
||||
fmt` command to auto-format the files if your editor doesn't do it for you.
|
||||
that we have a consistent style across the project. You can use the
|
||||
`task lint` command to lint the code locally and the `task lint:fix` command
|
||||
to try to automatically fix any issues that are found. You can also use the
|
||||
`task fmt` command to auto-format the files if your editor doesn't do it for
|
||||
you.
|
||||
- **Documentation** - Ensure that you add/update any relevant documentation. See
|
||||
the [updating documentation](#updating-documentation) section below.
|
||||
- **Tests** - Ensure that you add/update any relevant tests and that all tests
|
||||
@@ -82,17 +86,17 @@ by using `task website` (requires `nodejs` & `yarn`). All content is written in
|
||||
directory. All Markdown documents should have an 80 character line wrap limit
|
||||
(enforced by Prettier).
|
||||
|
||||
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
|
||||
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 command or flag, ensure that you add it to the [CLI
|
||||
Reference](/reference/cli.md). New fields also need to be added to the [Schema
|
||||
Reference](/reference/schema.md) and [JSON Schema][json-schema]. The descriptions
|
||||
for fields in the docs and the schema should match.
|
||||
If you added a new command or flag, ensure that you add it to the
|
||||
[CLI Reference](/reference/cli.md). New fields also need to be added to the
|
||||
[Schema Reference](/reference/schema.md) and [JSON Schema][json-schema]. The
|
||||
descriptions for fields in the docs and the schema should match.
|
||||
|
||||
### Writing tests
|
||||
|
||||
@@ -164,10 +168,12 @@ If you have questions, feel free to ask them in the `#help` forum channel on our
|
||||
[nodejs]: https://nodejs.org/en/
|
||||
[yarn]: https://yarnpkg.com/
|
||||
[docusaurus]: https://docusaurus.io
|
||||
[json-schema]: https://github.com/go-task/task/blob/main/website/static/schema.json
|
||||
[json-schema]:
|
||||
https://github.com/go-task/task/blob/main/website/static/schema.json
|
||||
[task-open-issues]: https://github.com/go-task/task/issues
|
||||
[vscode-task-open-issues]: https://github.com/go-task/vscode-task/issues
|
||||
[good-first-issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
|
||||
[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
|
||||
[conventional-commits]: https://www.conventionalcommits.org
|
||||
|
@@ -9,7 +9,8 @@ outline: deep
|
||||
|
||||
::: warning
|
||||
|
||||
All experimental features are subject to breaking changes and/or removal _at any time_. We strongly recommend that you do not use these features in a production
|
||||
All experimental features are subject to breaking changes and/or removal _at any
|
||||
time_. We strongly recommend that you do not use these features in a production
|
||||
environment. They are intended for testing and feedback only.
|
||||
|
||||
:::
|
||||
@@ -25,8 +26,9 @@ This experiment breaks the following functionality:
|
||||
::: info
|
||||
|
||||
To enable this experiment, set the environment variable:
|
||||
`TASK_X_ENV_PRECEDENCE=1`. Check out [our guide to enabling
|
||||
experiments](/experiments/#enabling-experiments) for more information.
|
||||
`TASK_X_ENV_PRECEDENCE=1`. Check out
|
||||
[our guide to enabling experiments](/experiments/#enabling-experiments) for more
|
||||
information.
|
||||
|
||||
:::
|
||||
|
||||
|
@@ -25,7 +25,9 @@ This experiment breaks the following functionality:
|
||||
::: info
|
||||
|
||||
To enable this experiment, set the environment variable:
|
||||
`TASK_X_GENTLE_FORCE=1`. Check out [our guide to enabling experiments](/experiments/#enabling-experiments) for more information.
|
||||
`TASK_X_GENTLE_FORCE=1`. Check out
|
||||
[our guide to enabling experiments](/experiments/#enabling-experiments) for more
|
||||
information.
|
||||
|
||||
:::
|
||||
|
||||
|
@@ -49,18 +49,18 @@ Which method you use depends on how you intend to use the experiment:
|
||||
export TASK_X_FEATURE=1
|
||||
```
|
||||
|
||||
3. Creating a `.env` or a `.taskrc.yml` file in the same directory as
|
||||
your root Taskfile.\
|
||||
The `.env` file should contain the relevant environment
|
||||
variable(s), while the `.taskrc.yml` file should use a YAML format
|
||||
where each experiment is defined as a key with a corresponding value.
|
||||
3. Creating a `.env` or a `.taskrc.yml` file in the same directory as your root
|
||||
Taskfile.\
|
||||
The `.env` file should contain the relevant environment variable(s), while
|
||||
the `.taskrc.yml` file should use a YAML format where each experiment is
|
||||
defined as a key with a corresponding value.
|
||||
|
||||
This allows you to enable an experimental feature at a project level. If you
|
||||
commit this file to source control, then other users of your project will
|
||||
also have these experiments enabled.
|
||||
|
||||
If both files are present, the values in the `.taskrc.yml` file
|
||||
will take precedence.
|
||||
If both files are present, the values in the `.taskrc.yml` file will take
|
||||
precedence.
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -136,13 +136,13 @@ version.
|
||||
|
||||
### 5. Released
|
||||
|
||||
When making a new major release of Task, all experiments marked as `status:
|
||||
stable` will move to `status: released` and their behaviors will become the new
|
||||
default in Task. Experiments in an earlier stage (i.e. not stable) cannot be
|
||||
released and so will continue to be experiments in the new version.
|
||||
When making a new major release of Task, all experiments marked as
|
||||
`status: stable` will move to `status: released` and their behaviors will become
|
||||
the new default in Task. Experiments in an earlier stage (i.e. not stable)
|
||||
cannot be released and so will continue to be experiments in the new version.
|
||||
|
||||
### Abandoned / Superseded
|
||||
|
||||
If an experiment is unsuccessful at any point then it will be given the `status:
|
||||
abandoned` or `status: superseded` labels depending on which is more suitable.
|
||||
These experiments will be removed from Task.
|
||||
If an experiment is unsuccessful at any point then it will be given the
|
||||
`status: abandoned` or `status: superseded` labels depending on which is more
|
||||
suitable. These experiments will be removed from Task.
|
||||
|
@@ -17,7 +17,9 @@ environment. They are intended for testing and feedback only.
|
||||
::: info
|
||||
|
||||
To enable this experiment, set the environment variable:
|
||||
`TASK_X_REMOTE_TASKFILES=1`. Check out [our guide to enabling experiments](/experiments/#enabling-experiments) for more information.
|
||||
`TASK_X_REMOTE_TASKFILES=1`. Check out
|
||||
[our guide to enabling experiments](/experiments/#enabling-experiments) for more
|
||||
information.
|
||||
|
||||
:::
|
||||
|
||||
@@ -59,8 +61,8 @@ git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||
This is the most basic type of remote node and works by downloading the file
|
||||
from the specified URL. The file must be a valid Taskfile and can be of any
|
||||
name. If a file is not found at the specified URL, Task will append each of the
|
||||
supported file names in turn until it finds a valid
|
||||
file. If it still does not find a valid Taskfile, an error is returned.
|
||||
supported file names in turn until it finds a valid file. If it still does not
|
||||
find a valid Taskfile, an error is returned.
|
||||
|
||||
### Git over HTTP
|
||||
|
||||
@@ -73,8 +75,8 @@ This is the same URL that you would use to clone the repo over HTTP.
|
||||
- You can optionally add the path to the Taskfile in the repository by appending
|
||||
`//<path>` to the URL.
|
||||
- You can also optionally specify a branch or tag to use by appending
|
||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default branch
|
||||
will be used.
|
||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default
|
||||
branch will be used.
|
||||
|
||||
### Git over SSH
|
||||
|
||||
@@ -90,11 +92,11 @@ SSH keys added so that they can be used during authentication.
|
||||
- You can optionally add the path to the Taskfile in the repository by appending
|
||||
`//<path>` to the URL.
|
||||
- You can also optionally specify a branch or tag to use by appending
|
||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default branch
|
||||
will be used.
|
||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default
|
||||
branch will be used.
|
||||
|
||||
Task has an example remote Taskfile in our repository
|
||||
that you can use for testing and that we will use throughout this document:
|
||||
Task has an example remote Taskfile in our repository that you can use for
|
||||
testing and that we will use throughout this document:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@@ -111,10 +113,10 @@ tasks:
|
||||
|
||||
## Specifying a remote entrypoint
|
||||
|
||||
By default, Task will look for one of the supported file
|
||||
names on your local filesystem. If you want to use a
|
||||
remote file instead, you can pass its URI into the `--taskfile`/`-t` flag just
|
||||
like you would to specify a different local file. For example:
|
||||
By default, Task will look for one of the supported file names on your local
|
||||
filesystem. If you want to use a remote file instead, you can pass its URI into
|
||||
the `--taskfile`/`-t` flag just like you would to specify a different local
|
||||
file. For example:
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -255,9 +257,8 @@ Task currently supports both `http` and `https` URLs. However, the `http`
|
||||
requests will not execute by default unless you run the task with the
|
||||
`--insecure` flag. This is to protect you from accidentally running a remote
|
||||
Taskfile that is downloaded via an unencrypted connection. Sources that are not
|
||||
protected by TLS are vulnerable to man-in-the-middle
|
||||
attacks and should be avoided unless you know what
|
||||
you are doing.
|
||||
protected by TLS are vulnerable to man-in-the-middle attacks and should be
|
||||
avoided unless you know what you are doing.
|
||||
|
||||
## Caching & Running Offline
|
||||
|
||||
@@ -281,11 +282,11 @@ the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will
|
||||
set the timeout to 5 seconds.
|
||||
|
||||
By default, the cache is stored in the Task temp directory, represented by the
|
||||
`TASK_TEMP_DIR` environment variable. You can
|
||||
override the location of the cache by setting the `TASK_REMOTE_DIR` environment
|
||||
variable. This way, you can share the cache between different projects.
|
||||
`TASK_TEMP_DIR` environment variable. You can override the location of the cache
|
||||
by setting the `TASK_REMOTE_DIR` environment variable. This way, you can share
|
||||
the cache between different projects.
|
||||
|
||||
You can force Task to ignore the cache and download the latest version
|
||||
by using the `--download` flag.
|
||||
You can force Task to ignore the cache and download the latest version by using
|
||||
the `--download` flag.
|
||||
|
||||
You can use the `--clear-cache` flag to clear all cached remote files.
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: FAQ
|
||||
description: Frequently asked questions about Task, including ETAs, shell limitations, and Windows compatibility
|
||||
description:
|
||||
Frequently asked questions about Task, including ETAs, shell limitations, and
|
||||
Windows compatibility
|
||||
outline: deep
|
||||
---
|
||||
|
||||
@@ -103,7 +105,8 @@ If you want to make your Taskfile fully cross-platform, you'll need to work
|
||||
around this limitation using one of the following methods:
|
||||
|
||||
- Use the <span v-pre>`{{OS}}`</span> function to run an OS-specific script.
|
||||
- Use something like <span v-pre>`{{if eq OS "windows"}}powershell {{end}}<my_cmd>`</span> to
|
||||
- Use something like
|
||||
<span v-pre>`{{if eq OS "windows"}}powershell {{end}}<my_cmd>`</span> 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][git-bash] or [WSL][wsl].
|
||||
|
@@ -8,8 +8,8 @@ outline: deep
|
||||
|
||||
The following guide will help introduce you to the basics of Task. We'll cover
|
||||
how to create a Taskfile, how to write a basic task and how to call it. If you
|
||||
haven't installed Task yet, head over to our [installation
|
||||
guide](installation.md).
|
||||
haven't installed Task yet, head over to our
|
||||
[installation guide](installation.md).
|
||||
|
||||
## Creating your first Taskfile
|
||||
|
||||
@@ -49,11 +49,11 @@ tasks:
|
||||
silent: true
|
||||
```
|
||||
|
||||
As you can see, all Taskfiles are written in [YAML format](https://yaml.org/). The `version`
|
||||
attribute specifies the minimum version of Task that can be used to run this
|
||||
file. The `vars` attribute is used to define variables that can be used in
|
||||
tasks. In this case, we are creating a string variable called `GREETING` with a
|
||||
value of `Hello, World!`.
|
||||
As you can see, all Taskfiles are written in [YAML format](https://yaml.org/).
|
||||
The `version` attribute specifies the minimum version of Task that can be used
|
||||
to run this file. The `vars` attribute is used to define variables that can be
|
||||
used in tasks. In this case, we are creating a string variable called `GREETING`
|
||||
with a value of `Hello, World!`.
|
||||
|
||||
Finally, the `tasks` attribute is used to define the tasks that can be run. In
|
||||
this case, we have a task called `default` that echoes the value of the
|
||||
@@ -71,10 +71,10 @@ task default
|
||||
```
|
||||
|
||||
Note that we don't have to specify the name of the Taskfile. Task will
|
||||
automatically look for a file called `Taskfile.yml` (or any of Task's [supported
|
||||
file names](usage.md#supported-file-names)) in the current directory. Additionally, tasks
|
||||
with the name `default` are special. They can also be run without specifying the
|
||||
task name.
|
||||
automatically look for a file called `Taskfile.yml` (or any of Task's
|
||||
[supported file names](usage.md#supported-file-names)) in the current directory.
|
||||
Additionally, tasks with the name `default` are special. They can also be run
|
||||
without specifying the task name.
|
||||
|
||||
If you created a Taskfile in a different directory, you can run it by passing
|
||||
the absolute or relative path to the directory as an argument using the `--dir`
|
||||
@@ -97,10 +97,10 @@ Let's create a task to build a program in Go. Start by adding a new task called
|
||||
`build` below the existing `default` task. We can then add a `cmds` attribute
|
||||
with a single command to build the program.
|
||||
|
||||
Task uses [mvdan/sh](https://github.com/mvdan/sh), a native Go sh interpreter. So you can write
|
||||
sh/bash-like commands - even in environments where `sh` or `bash` are usually
|
||||
not available (like Windows). Just remember any executables called must be
|
||||
available as a built-in or in the system's `PATH`.
|
||||
Task uses [mvdan/sh](https://github.com/mvdan/sh), a native Go sh interpreter.
|
||||
So you can write sh/bash-like commands - even in environments where `sh` or
|
||||
`bash` are usually not available (like Windows). Just remember any executables
|
||||
called must be available as a built-in or in the system's `PATH`.
|
||||
|
||||
When you're done, it should look something like this:
|
||||
|
||||
@@ -129,6 +129,6 @@ task build
|
||||
|
||||
That's about it for the basics, but there's _so much_ more that you can do with
|
||||
Task. Check out the rest of the documentation to learn more about all the
|
||||
features Task has to offer! We recommend taking a look at the [usage
|
||||
guide](usage.md) next. Alternatively, you can check out our reference docs for the
|
||||
[Taskfile schema](reference/schema.md) and [CLI](reference/cli.md).
|
||||
features Task has to offer! We recommend taking a look at the
|
||||
[usage guide](usage.md) next. Alternatively, you can check out our reference
|
||||
docs for the [Taskfile schema](reference/schema.md) and [CLI](reference/cli.md).
|
||||
|
@@ -10,8 +10,9 @@ Task offers many installation methods. Check out the available methods below.
|
||||
|
||||
::: info
|
||||
|
||||
Some of the methods below are marked as . This means they
|
||||
are not maintained by the Task team and may not be up-to-date.
|
||||
Some of the methods below are marked as
|
||||
. This means
|
||||
they are not maintained by the Task team and may not be up-to-date.
|
||||
|
||||
:::
|
||||
|
||||
@@ -19,15 +20,17 @@ are not maintained by the Task team and may not be up-to-date.
|
||||
|
||||
### [Homebrew](https://brew.sh)   {#homebrew}
|
||||
|
||||
Task is available via our official Homebrew tap [[source](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb)]:
|
||||
Task is available via our official Homebrew tap
|
||||
[[source](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb)]:
|
||||
|
||||
```shell
|
||||
brew install go-task/tap/go-task
|
||||
```
|
||||
|
||||
Alternatively it can be installed from the official Homebrew
|
||||
repository [[package](https://formulae.brew.sh/formula/go-task)]
|
||||
[[source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/go-task.rb)] by running:
|
||||
Alternatively it can be installed from the official Homebrew repository
|
||||
[[package](https://formulae.brew.sh/formula/go-task)]
|
||||
[[source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/go-task.rb)]
|
||||
by running:
|
||||
|
||||
```shell
|
||||
brew install go-task
|
||||
@@ -35,7 +38,9 @@ brew install go-task
|
||||
|
||||
### [Macports](https://macports.org)   {#macports}
|
||||
|
||||
Task repository is tracked by Macports [[package](https://ports.macports.org/port/go-task/details/)] [[source](https://github.com/macports/macports-ports/blob/master/devel/go-task/Portfile)]:
|
||||
Task repository is tracked by Macports
|
||||
[[package](https://ports.macports.org/port/go-task/details/)]
|
||||
[[source](https://github.com/macports/macports-ports/blob/master/devel/go-task/Portfile)]:
|
||||
|
||||
```shell
|
||||
port install go-task
|
||||
@@ -43,8 +48,10 @@ port install go-task
|
||||
|
||||
### [Snap](https://snapcraft.io/task)   {#snap}
|
||||
|
||||
Task is available on [Snapcraft](https://snapcraft.io/task) [[source](https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml)], but keep in mind that your Linux
|
||||
distribution should allow classic confinement for Snaps to Task work correctly:
|
||||
Task is available on [Snapcraft](https://snapcraft.io/task)
|
||||
[[source](https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml)], but
|
||||
keep in mind that your Linux distribution should allow classic confinement for
|
||||
Snaps to Task work correctly:
|
||||
|
||||
```shell
|
||||
sudo snap install task --classic
|
||||
@@ -54,7 +61,8 @@ sudo snap install task --classic
|
||||
|
||||
Npm can be used as cross-platform way to install Task globally or as a
|
||||
dependency of your project
|
||||
[[package](https://www.npmjs.com/package/@go-task/cli)] [[source](https://github.com/go-task/task/blob/main/package.json)]:
|
||||
[[package](https://www.npmjs.com/package/@go-task/cli)]
|
||||
[[source](https://github.com/go-task/task/blob/main/package.json)]:
|
||||
|
||||
```shell
|
||||
npm install -g @go-task/cli
|
||||
@@ -63,7 +71,8 @@ npm install -g @go-task/cli
|
||||
### [pip](https://pip.pypa.io)     {#pip}
|
||||
|
||||
Like npm, pip can be used as a cross-platform way to install Task
|
||||
[[package](https://pypi.org/project/go-task-bin)] [[source](https://github.com/Bing-su/pip-binary-factory/tree/main/task)]:
|
||||
[[package](https://pypi.org/project/go-task-bin)]
|
||||
[[source](https://github.com/Bing-su/pip-binary-factory/tree/main/task)]:
|
||||
|
||||
```shell
|
||||
pip install go-task-bin
|
||||
@@ -71,7 +80,9 @@ pip install go-task-bin
|
||||
|
||||
### [WinGet](https://github.com/microsoft/winget-cli)  {#winget}
|
||||
|
||||
Task is available via the [community repository](https://github.com/microsoft/winget-pkgs) [[source](https://github.com/microsoft/winget-pkgs/tree/master/manifests/t/Task/Task)]:
|
||||
Task is available via the
|
||||
[community repository](https://github.com/microsoft/winget-pkgs)
|
||||
[[source](https://github.com/microsoft/winget-pkgs/tree/master/manifests/t/Task/Task)]:
|
||||
|
||||
```shell
|
||||
winget install Task.Task
|
||||
@@ -79,7 +90,8 @@ winget install Task.Task
|
||||
|
||||
### [Chocolatey](https://chocolatey.org)   {#chocolatey}
|
||||
|
||||
[[package](https://community.chocolatey.org/packages/go-task)] [[source](https://github.com/Starz0r/ChocolateyPackagingScripts/blob/master/src/go-task_gh_build.py)]
|
||||
[[package](https://community.chocolatey.org/packages/go-task)]
|
||||
[[source](https://github.com/Starz0r/ChocolateyPackagingScripts/blob/master/src/go-task_gh_build.py)]
|
||||
|
||||
```shell
|
||||
choco install go-task
|
||||
@@ -95,7 +107,8 @@ scoop install task
|
||||
|
||||
### Arch ([pacman](https://wiki.archlinux.org/title/Pacman))   {#arch}
|
||||
|
||||
[[package](https://archlinux.org/packages/extra/x86_64/go-task/)] [[source](https://gitlab.archlinux.org/archlinux/packaging/packages/go-task)]
|
||||
[[package](https://archlinux.org/packages/extra/x86_64/go-task/)]
|
||||
[[source](https://gitlab.archlinux.org/archlinux/packaging/packages/go-task)]
|
||||
|
||||
```shell
|
||||
pacman -S go-task
|
||||
@@ -103,7 +116,8 @@ pacman -S go-task
|
||||
|
||||
### Fedora ([dnf](https://docs.fedoraproject.org/en-US/quick-docs/dnf))   {#fedora}
|
||||
|
||||
[[package](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)] [[source](https://src.fedoraproject.org/rpms/golang-github-task)]
|
||||
[[package](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)]
|
||||
[[source](https://src.fedoraproject.org/rpms/golang-github-task)]
|
||||
|
||||
```shell
|
||||
dnf install go-task
|
||||
@@ -111,7 +125,8 @@ dnf install go-task
|
||||
|
||||
### FreeBSD ([Ports](https://ports.freebsd.org/cgi/ports.cgi))   {#freebsd}
|
||||
|
||||
[[package](https://cgit.freebsd.org/ports/tree/devel/task)] [[source](https://cgit.freebsd.org/ports/tree/devel/task/Makefile)]
|
||||
[[package](https://cgit.freebsd.org/ports/tree/devel/task)]
|
||||
[[source](https://cgit.freebsd.org/ports/tree/devel/task/Makefile)]
|
||||
|
||||
```shell
|
||||
pkg install task
|
||||
@@ -127,7 +142,8 @@ nix-env -iA nixpkgs.go-task
|
||||
|
||||
### [pacstall](https://github.com/pacstall/pacstall)    {#pacstall}
|
||||
|
||||
[[package](https://pacstall.dev/packages/go-task-deb)] [[source](https://github.com/pacstall/pacstall-programs/blob/master/packages/go-task-deb/go-task-deb.pacscript)]
|
||||
[[package](https://pacstall.dev/packages/go-task-deb)]
|
||||
[[source](https://github.com/pacstall/pacstall-programs/blob/master/packages/go-task-deb/go-task-deb.pacscript)]
|
||||
|
||||
```shell
|
||||
pacstall -I go-task-deb
|
||||
@@ -135,7 +151,8 @@ pacstall -I go-task-deb
|
||||
|
||||
### [pkgx](https://pkgx.sh)    {#pkgx}
|
||||
|
||||
[[package](https://pkgx.dev/pkgs/taskfile.dev)] [[source](https://github.com/pkgxdev/pantry/blob/main/projects/taskfile.dev/package.yml)]
|
||||
[[package](https://pkgx.dev/pkgs/taskfile.dev)]
|
||||
[[source](https://github.com/pkgxdev/pantry/blob/main/projects/taskfile.dev/package.yml)]
|
||||
|
||||
```shell
|
||||
pkgx task
|
||||
@@ -151,8 +168,9 @@ task
|
||||
|
||||
### 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](https://github.com/go-task/task/releases) and add to
|
||||
your `$PATH`.
|
||||
|
||||
DEB and RPM packages are also available.
|
||||
|
||||
@@ -160,9 +178,11 @@ 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/main/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](https://github.com/go-task/task/blob/main/install-task.sh)
|
||||
which is very useful in scenarios like CI. Many thanks to
|
||||
[GoDownloader](https://github.com/goreleaser/godownloader) for enabling the easy
|
||||
generation of this script.
|
||||
|
||||
By default, it installs on the `./bin` directory relative to the working
|
||||
directory:
|
||||
@@ -186,15 +206,16 @@ default.
|
||||
|
||||
:::
|
||||
|
||||
By default, it installs the latest version available.
|
||||
You can also specify a tag (available in [releases](https://github.com/go-task/task/releases))
|
||||
to install a specific version:
|
||||
By default, it installs the latest version available. You can also specify a tag
|
||||
(available in [releases](https://github.com/go-task/task/releases)) to install a
|
||||
specific version:
|
||||
|
||||
```shell
|
||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d v3.36.0
|
||||
```
|
||||
|
||||
Parameters are order specific, to set both installation directory and version:
|
||||
|
||||
```shell
|
||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin v3.42.1
|
||||
```
|
||||
@@ -218,8 +239,8 @@ 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
|
||||
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/main/go.mod#L3) file.
|
||||
|
||||
You can then install the latest release globally by running:
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Integrations
|
||||
description: Official and community integrations for Task, including VS Code, JSON schemas, and other tools
|
||||
description:
|
||||
Official and community integrations for Task, including VS Code, JSON schemas,
|
||||
and other tools
|
||||
outline: deep
|
||||
---
|
||||
|
||||
|
@@ -15,7 +15,8 @@ task [options] [tasks...] [-- CLI_ARGS...]
|
||||
|
||||
::: tip
|
||||
|
||||
If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable
|
||||
If `--` is given, all remaining arguments will be assigned to a special
|
||||
`CLI_ARGS` variable
|
||||
|
||||
:::
|
||||
|
||||
@@ -252,7 +253,8 @@ task build --watch
|
||||
|
||||
#### `-I, --interval <duration>`
|
||||
|
||||
Set watch interval (default: `5s`). Must be a valid [Go duration](https://pkg.go.dev/time#ParseDuration).
|
||||
Set watch interval (default: `5s`). Must be a valid
|
||||
[Go duration](https://pkg.go.dev/time#ParseDuration).
|
||||
|
||||
```bash
|
||||
task build --watch --interval 1s
|
||||
@@ -273,12 +275,15 @@ task deploy --yes
|
||||
Task uses specific exit codes to indicate different types of errors:
|
||||
|
||||
### Success
|
||||
|
||||
- **0** - Success
|
||||
|
||||
### General Errors (1-99)
|
||||
|
||||
- **1** - Unknown error occurred
|
||||
|
||||
### Taskfile Errors (100-199)
|
||||
|
||||
- **100** - No Taskfile found
|
||||
- **101** - Taskfile already exists (when using `--init`)
|
||||
- **102** - Invalid or unparseable Taskfile
|
||||
@@ -289,6 +294,7 @@ Task uses specific exit codes to indicate different types of errors:
|
||||
- **107** - No schema version defined in Taskfile
|
||||
|
||||
### Task Errors (200-255)
|
||||
|
||||
- **200** - Task not found
|
||||
- **201** - Command execution error
|
||||
- **202** - Attempted to run internal task
|
||||
@@ -300,13 +306,15 @@ Task uses specific exit codes to indicate different types of errors:
|
||||
|
||||
::: info
|
||||
|
||||
When using `-x/--exit-code`, failed command exit codes are passed through instead of the above codes.
|
||||
When using `-x/--exit-code`, failed command exit codes are passed through
|
||||
instead of the above codes.
|
||||
|
||||
:::
|
||||
|
||||
::: tip
|
||||
|
||||
The complete list of exit codes is available in the repository at [`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go).
|
||||
The complete list of exit codes is available in the repository at
|
||||
[`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go).
|
||||
|
||||
:::
|
||||
|
||||
|
@@ -41,7 +41,8 @@ allows the user to fetch and execute tasks from a Taskfile.
|
||||
|
||||
::: info
|
||||
|
||||
This is the package which is most likely to be the subject of breaking changes as we refine the API.
|
||||
This is the package which is most likely to be the subject of breaking changes
|
||||
as we refine the API.
|
||||
|
||||
:::
|
||||
|
||||
@@ -139,30 +140,42 @@ namespaces and tasks from all the Taskfiles we read.
|
||||
|
||||
::: info
|
||||
|
||||
We plan to remove AST merging in the future as it is unnecessarily complex and causes lots of issues with scoping.
|
||||
We plan to remove AST merging in the future as it is unnecessarily complex and
|
||||
causes lots of issues with scoping.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
[`github.com/go-task/task/v3`]: https://pkg.go.dev/github.com/go-task/task/v3
|
||||
[`github.com/go-task/task/v3/taskfile`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile
|
||||
[`github.com/go-task/task/v3/taskfile/ast`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast
|
||||
[`github.com/go-task/task/v3/errors`]: https://pkg.go.dev/github.com/go-task/task/v3/errors
|
||||
|
||||
[`ast.TaskfileGraph`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#TaskfileGraph
|
||||
[`ast.Taskfile`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#Taskfile
|
||||
[`github.com/go-task/task/v3/taskfile`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile
|
||||
[`github.com/go-task/task/v3/taskfile/ast`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast
|
||||
[`github.com/go-task/task/v3/errors`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/errors
|
||||
[`ast.TaskfileGraph`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#TaskfileGraph
|
||||
[`ast.Taskfile`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#Taskfile
|
||||
[`taskfile.Node`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Node
|
||||
[`taskfile.FileNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#FileNode
|
||||
[`taskfile.HTTPNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#HTTPNode
|
||||
[`taskfile.GitNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#GitNode
|
||||
[`taskfile.StdinNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#StdinNode
|
||||
[`taskfile.NewFileNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewFileNode
|
||||
[`taskfile.Reader`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Reader
|
||||
[`taskfile.NewReader`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewReader
|
||||
[`taskfile.Snippet`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Snippet
|
||||
[`taskfile.FileNode`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#FileNode
|
||||
[`taskfile.HTTPNode`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#HTTPNode
|
||||
[`taskfile.GitNode`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#GitNode
|
||||
[`taskfile.StdinNode`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#StdinNode
|
||||
[`taskfile.NewFileNode`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewFileNode
|
||||
[`taskfile.Reader`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Reader
|
||||
[`taskfile.NewReader`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewReader
|
||||
[`taskfile.Snippet`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Snippet
|
||||
[`task.Executor`]: https://pkg.go.dev/github.com/go-task/task/v3#Executor
|
||||
[`task.Formatter`]: https://pkg.go.dev/github.com/go-task/task/v3#Formatter
|
||||
[`errors.TaskError`]: https://pkg.go.dev/github.com/go-task/task/v3/errors#TaskError
|
||||
[`errors.TaskError`]:
|
||||
https://pkg.go.dev/github.com/go-task/task/v3/errors#TaskError
|
||||
[`error`]: https://pkg.go.dev/builtin#error
|
||||
|
||||
[ast]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
|
||||
|
@@ -1,12 +1,15 @@
|
||||
---
|
||||
title: Schema Reference
|
||||
description: Complete reference for the Taskfile schema based on the official JSON schema
|
||||
description:
|
||||
Complete reference for the Taskfile schema based on the official JSON schema
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Schema Reference
|
||||
|
||||
This page documents all available properties and types for the Taskfile schema version 3, based on the [official JSON schema](https://taskfile.dev/schema.json).
|
||||
This page documents all available properties and types for the Taskfile schema
|
||||
version 3, based on the
|
||||
[official JSON schema](https://taskfile.dev/schema.json).
|
||||
|
||||
## Root Schema
|
||||
|
||||
@@ -186,7 +189,8 @@ interval: 1s
|
||||
### `set`
|
||||
|
||||
- **Type**: `[]string`
|
||||
- **Options**: `allexport`, `a`, `errexit`, `e`, `noexec`, `n`, `noglob`, `f`, `nounset`, `u`, `xtrace`, `x`, `pipefail`
|
||||
- **Options**: `allexport`, `a`, `errexit`, `e`, `noexec`, `n`, `noglob`, `f`,
|
||||
`nounset`, `u`, `xtrace`, `x`, `pipefail`
|
||||
- **Description**: POSIX shell options for all commands
|
||||
|
||||
```yaml
|
||||
@@ -322,7 +326,8 @@ includes:
|
||||
|
||||
## Variable
|
||||
|
||||
Variables support multiple types and can be static values, dynamic commands, references, or maps.
|
||||
Variables support multiple types and can be static values, dynamic commands,
|
||||
references, or maps.
|
||||
|
||||
### Static Variables
|
||||
|
||||
@@ -381,7 +386,7 @@ Variables can reference previously defined variables:
|
||||
vars:
|
||||
GREETING: Hello
|
||||
TARGET: World
|
||||
MESSAGE: "{{.GREETING}} {{.TARGET}}!"
|
||||
MESSAGE: '{{.GREETING}} {{.TARGET}}!'
|
||||
```
|
||||
|
||||
## Task
|
||||
@@ -470,7 +475,7 @@ tasks:
|
||||
- for: [unit, integration, e2e]
|
||||
task: test
|
||||
vars:
|
||||
TEST_TYPE: "{{.ITEM}}"
|
||||
TEST_TYPE: '{{.ITEM}}'
|
||||
cmds:
|
||||
- echo "All tests completed"
|
||||
```
|
||||
@@ -539,10 +544,10 @@ tasks:
|
||||
tasks:
|
||||
build:
|
||||
sources:
|
||||
- "**/*.go"
|
||||
- '**/*.go'
|
||||
- go.mod
|
||||
# With exclusions
|
||||
- exclude: "**/*_test.go"
|
||||
- exclude: '**/*_test.go'
|
||||
cmds:
|
||||
- go build ./...
|
||||
```
|
||||
@@ -555,10 +560,10 @@ tasks:
|
||||
```yaml
|
||||
tasks:
|
||||
build:
|
||||
sources: ["**/*.go"]
|
||||
sources: ['**/*.go']
|
||||
generates:
|
||||
- "./app"
|
||||
- exclude: "*.debug"
|
||||
- './app'
|
||||
- exclude: '*.debug'
|
||||
cmds:
|
||||
- go build -o app ./cmd
|
||||
```
|
||||
@@ -596,7 +601,7 @@ tasks:
|
||||
deploy:
|
||||
preconditions:
|
||||
- sh: test -n "$API_KEY"
|
||||
msg: "API_KEY environment variable is required"
|
||||
msg: 'API_KEY environment variable is required'
|
||||
- sh: test -f ./app
|
||||
msg: "Application binary not found. Run 'task build' first."
|
||||
cmds:
|
||||
@@ -736,7 +741,7 @@ tasks:
|
||||
```yaml
|
||||
tasks:
|
||||
process-files:
|
||||
sources: ["*.txt"]
|
||||
sources: ['*.txt']
|
||||
cmds:
|
||||
- for: sources
|
||||
cmd: wc -l {{.ITEM}}
|
||||
@@ -750,11 +755,11 @@ tasks:
|
||||
tasks:
|
||||
process-items:
|
||||
vars:
|
||||
ITEMS: "item1,item2,item3"
|
||||
ITEMS: 'item1,item2,item3'
|
||||
cmds:
|
||||
- for:
|
||||
var: ITEMS
|
||||
split: ","
|
||||
split: ','
|
||||
as: CURRENT
|
||||
cmd: echo "Processing {{.CURRENT}}"
|
||||
```
|
||||
@@ -781,10 +786,9 @@ tasks:
|
||||
- for: [frontend, backend, worker]
|
||||
task: build
|
||||
vars:
|
||||
SERVICE: "{{.ITEM}}"
|
||||
SERVICE: '{{.ITEM}}'
|
||||
```
|
||||
|
||||
|
||||
## Shell Options
|
||||
|
||||
### Set Options
|
||||
|
@@ -1,16 +1,23 @@
|
||||
---
|
||||
title: Templating Reference
|
||||
description: Comprehensive guide to Task's templating system with Go text/template, special variables, and available functions
|
||||
description:
|
||||
Comprehensive guide to Task's templating system with Go text/template, special
|
||||
variables, and available functions
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Templating Reference
|
||||
|
||||
Task's templating engine uses Go's [text/template](https://pkg.go.dev/text/template) package to interpolate values. This reference covers the main features and all available functions for creating dynamic Taskfiles.
|
||||
Task's templating engine uses Go's
|
||||
[text/template](https://pkg.go.dev/text/template) package to interpolate values.
|
||||
This reference covers the main features and all available functions for creating
|
||||
dynamic Taskfiles.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
Most string values in Task can be templated using double curly braces <span v-pre>`{{` and `}}`</span>. Anything inside the braces is executed as a Go template.
|
||||
Most string values in Task can be templated using double curly braces
|
||||
<span v-pre>`{{` and `}}`</span>. Anything inside the braces is executed as a Go
|
||||
template.
|
||||
|
||||
### Simple Variable Interpolation
|
||||
|
||||
@@ -26,6 +33,7 @@ tasks:
|
||||
```
|
||||
|
||||
**Output:**
|
||||
|
||||
```
|
||||
Hello, World!
|
||||
```
|
||||
@@ -46,6 +54,7 @@ tasks:
|
||||
```
|
||||
|
||||
**Output:**
|
||||
|
||||
```
|
||||
:)
|
||||
```
|
||||
@@ -64,6 +73,7 @@ tasks:
|
||||
```
|
||||
|
||||
**Output:**
|
||||
|
||||
```
|
||||
0, 1, 2, 3
|
||||
```
|
||||
@@ -86,6 +96,7 @@ tasks:
|
||||
```
|
||||
|
||||
**Output:**
|
||||
|
||||
```
|
||||
0: 0
|
||||
1: 1
|
||||
@@ -95,11 +106,13 @@ tasks:
|
||||
|
||||
## Special Variables
|
||||
|
||||
Task provides special variables that are always available in templates. These override any user-defined variables with the same name.
|
||||
Task provides special variables that are always available in templates. These
|
||||
override any user-defined variables with the same name.
|
||||
|
||||
### CLI
|
||||
|
||||
#### `CLI_ARGS`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: All extra arguments passed after `--` as a string
|
||||
|
||||
@@ -116,6 +129,7 @@ task test -- -v -race
|
||||
```
|
||||
|
||||
#### `CLI_ARGS_LIST`
|
||||
|
||||
- **Type**: `[]string`
|
||||
- **Description**: All extra arguments passed after `--` as a shell parsed list
|
||||
|
||||
@@ -127,6 +141,7 @@ tasks:
|
||||
```
|
||||
|
||||
#### `CLI_FORCE`
|
||||
|
||||
- **Type**: `bool`
|
||||
- **Description**: Whether `--force` or `--force-all` flags were set
|
||||
|
||||
@@ -142,20 +157,24 @@ tasks:
|
||||
```
|
||||
|
||||
#### `CLI_SILENT`
|
||||
|
||||
- **Type**: `bool`
|
||||
- **Description**: Whether `--silent` flag was set
|
||||
|
||||
#### `CLI_VERBOSE`
|
||||
|
||||
- **Type**: `bool`
|
||||
- **Description**: Whether `--verbose` flag was set
|
||||
|
||||
#### `CLI_OFFLINE`
|
||||
|
||||
- **Type**: `bool`
|
||||
- **Description**: Whether `--offline` flag was set
|
||||
|
||||
### Task
|
||||
|
||||
#### `TASK`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Name of the current task
|
||||
|
||||
@@ -167,10 +186,12 @@ tasks:
|
||||
```
|
||||
|
||||
#### `ALIAS`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Alias used for the current task, otherwise matches `TASK`
|
||||
|
||||
#### `TASK_EXE`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Task executable name or path
|
||||
|
||||
@@ -184,26 +205,32 @@ tasks:
|
||||
### File Paths
|
||||
|
||||
#### `ROOT_TASKFILE`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Absolute path of the root Taskfile
|
||||
|
||||
#### `ROOT_DIR`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Absolute path of the root Taskfile directory
|
||||
|
||||
#### `TASKFILE`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Absolute path of the current (included) Taskfile
|
||||
|
||||
#### `TASKFILE_DIR`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Absolute path of the current Taskfile directory
|
||||
|
||||
#### `TASK_DIR`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Absolute path where the task is executed
|
||||
|
||||
#### `USER_WORKING_DIR`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Absolute path where `task` was called from
|
||||
|
||||
@@ -219,18 +246,22 @@ tasks:
|
||||
### Status
|
||||
|
||||
#### `CHECKSUM`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Checksum of files in `sources` (only in `status` with `checksum` method)
|
||||
- **Description**: Checksum of files in `sources` (only in `status` with
|
||||
`checksum` method)
|
||||
|
||||
#### `TIMESTAMP`
|
||||
|
||||
- **Type**: `time.Time`
|
||||
- **Description**: Greatest timestamp of files in `sources` (only in `status` with `timestamp` method)
|
||||
- **Description**: Greatest timestamp of files in `sources` (only in `status`
|
||||
with `timestamp` method)
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
build:
|
||||
method: checksum
|
||||
sources: ["**/*.go"]
|
||||
sources: ['**/*.go']
|
||||
status:
|
||||
- test "{{.CHECKSUM}}" = "$(cat .last-checksum)"
|
||||
cmds:
|
||||
@@ -241,6 +272,7 @@ tasks:
|
||||
### Loop
|
||||
|
||||
#### `ITEM`
|
||||
|
||||
- **Type**: `any`
|
||||
- **Description**: Current iteration value when using `for` property
|
||||
|
||||
@@ -267,8 +299,10 @@ tasks:
|
||||
### Defer
|
||||
|
||||
#### `EXIT_CODE`
|
||||
|
||||
- **Type**: `int`
|
||||
- **Description**: Failed command exit code (only in `defer`, only when non-zero)
|
||||
- **Description**: Failed command exit code (only in `defer`, only when
|
||||
non-zero)
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
@@ -285,6 +319,7 @@ tasks:
|
||||
### System
|
||||
|
||||
#### `TASK_VERSION`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Description**: Current version of Task
|
||||
|
||||
@@ -297,26 +332,33 @@ tasks:
|
||||
|
||||
## Built-in Functions
|
||||
|
||||
These functions are provided by Go's [text/template](https://pkg.go.dev/text/template#hdr-Functions) package.
|
||||
These functions are provided by Go's
|
||||
[text/template](https://pkg.go.dev/text/template#hdr-Functions) package.
|
||||
|
||||
### Logic Functions
|
||||
|
||||
#### `and`
|
||||
|
||||
Boolean AND operation
|
||||
|
||||
```yaml
|
||||
cmds:
|
||||
- echo "{{if and .DEBUG .VERBOSE}}Debug mode{{end}}"
|
||||
```
|
||||
|
||||
#### `or`
|
||||
|
||||
Boolean OR operation
|
||||
|
||||
```yaml
|
||||
cmds:
|
||||
- echo "{{if or .DEV .STAGING}}Non-production{{end}}"
|
||||
```
|
||||
|
||||
#### `not`
|
||||
|
||||
Boolean negation
|
||||
|
||||
```yaml
|
||||
cmds:
|
||||
- echo "{{if not .PRODUCTION}}Development build{{end}}"
|
||||
@@ -325,7 +367,9 @@ cmds:
|
||||
### Data Access
|
||||
|
||||
#### `index`
|
||||
|
||||
Access array/map elements
|
||||
|
||||
```yaml
|
||||
vars:
|
||||
SERVICES: [api, web, worker]
|
||||
@@ -334,7 +378,9 @@ cmds:
|
||||
```
|
||||
|
||||
#### `len`
|
||||
|
||||
Get length of arrays, maps, or strings
|
||||
|
||||
```yaml
|
||||
vars:
|
||||
ITEMS: [a, b, c, d]
|
||||
@@ -343,7 +389,9 @@ cmds:
|
||||
```
|
||||
|
||||
#### `slice`
|
||||
|
||||
Get slice of array/string
|
||||
|
||||
```yaml
|
||||
vars:
|
||||
ITEMS: [a, b, c, d, e]
|
||||
@@ -354,7 +402,9 @@ cmds:
|
||||
### Output Functions
|
||||
|
||||
#### `print`, `printf`, `println`
|
||||
|
||||
Formatted output functions
|
||||
|
||||
```yaml
|
||||
cmds:
|
||||
- echo "{{printf "Version: %s.%d" .VERSION .BUILD}}"
|
||||
@@ -362,7 +412,8 @@ cmds:
|
||||
|
||||
## Slim-Sprig Functions
|
||||
|
||||
Task includes functions from [slim-sprig](https://go-task.github.io/slim-sprig/) for enhanced templating capabilities.
|
||||
Task includes functions from [slim-sprig](https://go-task.github.io/slim-sprig/)
|
||||
for enhanced templating capabilities.
|
||||
|
||||
### String Functions
|
||||
|
||||
@@ -372,8 +423,8 @@ Task includes functions from [slim-sprig](https://go-task.github.io/slim-sprig/)
|
||||
tasks:
|
||||
string-demo:
|
||||
vars:
|
||||
MESSAGE: " Hello World "
|
||||
NAME: "john doe"
|
||||
MESSAGE: ' Hello World '
|
||||
NAME: 'john doe'
|
||||
cmds:
|
||||
- echo "{{.MESSAGE | trim}}" # "Hello World"
|
||||
- echo "{{.NAME | title}}" # "John Doe"
|
||||
@@ -387,7 +438,7 @@ tasks:
|
||||
tasks:
|
||||
check:
|
||||
vars:
|
||||
FILENAME: "app.tar.gz"
|
||||
FILENAME: 'app.tar.gz'
|
||||
cmds:
|
||||
- |
|
||||
{{if .FILENAME | hasPrefix "app"}}
|
||||
@@ -405,7 +456,7 @@ tasks:
|
||||
tasks:
|
||||
process:
|
||||
vars:
|
||||
TEXT: "Hello, World!"
|
||||
TEXT: 'Hello, World!'
|
||||
cmds:
|
||||
- echo "{{.TEXT | replace "," ""}}" # "Hello World!"
|
||||
- echo "{{.TEXT | quote}}" # "\"Hello, World!\""
|
||||
@@ -419,8 +470,8 @@ tasks:
|
||||
tasks:
|
||||
regex-demo:
|
||||
vars:
|
||||
EMAIL: "user@example.com"
|
||||
TEXT: "abc123def456"
|
||||
EMAIL: 'user@example.com'
|
||||
TEXT: 'abc123def456'
|
||||
cmds:
|
||||
- echo "{{regexMatch "@" .EMAIL}}" # true
|
||||
- echo "{{regexFind "[0-9]+" .TEXT}}" # "123"
|
||||
@@ -451,7 +502,7 @@ tasks:
|
||||
manipulate:
|
||||
vars:
|
||||
NUMBERS: [3, 1, 4, 1, 5, 9, 1]
|
||||
FRUITS: ["apple", "banana"]
|
||||
FRUITS: ['apple', 'banana']
|
||||
cmds:
|
||||
- echo "{{.NUMBERS | uniq}}" # [3, 1, 4, 5, 9]
|
||||
- echo "{{.NUMBERS | sortAlpha}}" # [1, 1, 1, 3, 4, 5, 9]
|
||||
@@ -465,8 +516,8 @@ tasks:
|
||||
tasks:
|
||||
string-lists:
|
||||
vars:
|
||||
CSV: "apple,banana,cherry"
|
||||
WORDS: ["hello", "world", "from", "task"]
|
||||
CSV: 'apple,banana,cherry'
|
||||
WORDS: ['hello', 'world', 'from', 'task']
|
||||
cmds:
|
||||
- echo "{{.CSV | splitList ","}}" # ["apple", "banana", "cherry"]
|
||||
- echo "{{.WORDS | join " "}}" # "hello world from task"
|
||||
@@ -548,8 +599,8 @@ tasks:
|
||||
encoding:
|
||||
vars:
|
||||
DATA:
|
||||
name: "Task"
|
||||
version: "3.0"
|
||||
name: 'Task'
|
||||
version: '3.0'
|
||||
cmds:
|
||||
- echo "{{.DATA | toJson}}"
|
||||
- echo "{{.DATA | toPrettyJson}}"
|
||||
@@ -563,8 +614,8 @@ tasks:
|
||||
tasks:
|
||||
convert:
|
||||
vars:
|
||||
NUM_STR: "42"
|
||||
FLOAT_STR: "3.14"
|
||||
NUM_STR: '42'
|
||||
FLOAT_STR: '3.14'
|
||||
ITEMS: [1, 2, 3]
|
||||
cmds:
|
||||
- echo "{{.NUM_STR | atoi | add 8}}" # 50
|
||||
@@ -579,7 +630,9 @@ Task provides additional functions for common operations.
|
||||
### System Functions
|
||||
|
||||
#### `OS`
|
||||
|
||||
Get the operating system
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
build:
|
||||
@@ -593,7 +646,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `ARCH`
|
||||
|
||||
Get the system architecture
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
info:
|
||||
@@ -602,7 +657,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `numCPU`
|
||||
|
||||
Get number of CPU cores
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
test:
|
||||
@@ -613,7 +670,9 @@ tasks:
|
||||
### Path Functions
|
||||
|
||||
#### `toSlash` / `fromSlash`
|
||||
|
||||
Convert path separators
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
paths:
|
||||
@@ -624,7 +683,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `joinPath`
|
||||
|
||||
Join path elements
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
build:
|
||||
@@ -636,7 +697,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `relPath`
|
||||
|
||||
Get relative path
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
info:
|
||||
@@ -647,7 +710,9 @@ tasks:
|
||||
### String Processing
|
||||
|
||||
#### `splitLines`
|
||||
|
||||
Split on newlines (Unix and Windows)
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
process:
|
||||
@@ -664,7 +729,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `catLines`
|
||||
|
||||
Replace newlines with spaces
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
flatten:
|
||||
@@ -677,19 +744,23 @@ tasks:
|
||||
```
|
||||
|
||||
#### `shellQuote` (alias: `q`)
|
||||
|
||||
Quote for shell safety
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
safe:
|
||||
vars:
|
||||
FILENAME: "file with spaces.txt"
|
||||
FILENAME: 'file with spaces.txt'
|
||||
cmds:
|
||||
- ls -la {{.FILENAME | shellQuote}}
|
||||
- cat {{.FILENAME | q}} # Short alias
|
||||
```
|
||||
|
||||
#### `splitArgs`
|
||||
|
||||
Parse shell arguments
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
parse:
|
||||
@@ -705,7 +776,9 @@ tasks:
|
||||
### Data Functions
|
||||
|
||||
#### `merge`
|
||||
|
||||
Merge maps
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
config:
|
||||
@@ -721,7 +794,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `spew`
|
||||
|
||||
Debug variable contents
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
debug:
|
||||
@@ -737,7 +812,9 @@ tasks:
|
||||
### YAML Functions
|
||||
|
||||
#### `fromYaml` / `toYaml`
|
||||
|
||||
YAML encoding/decoding
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
yaml-demo:
|
||||
@@ -754,7 +831,9 @@ tasks:
|
||||
### Utility Functions
|
||||
|
||||
#### `uuid`
|
||||
|
||||
Generate UUID
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
deploy:
|
||||
@@ -765,7 +844,9 @@ tasks:
|
||||
```
|
||||
|
||||
#### `randIntN`
|
||||
|
||||
Generate random integer
|
||||
|
||||
```yaml
|
||||
tasks:
|
||||
test:
|
||||
@@ -865,19 +946,19 @@ vars:
|
||||
PLATFORMS:
|
||||
- os: linux
|
||||
arch: amd64
|
||||
cgo: "1"
|
||||
cgo: '1'
|
||||
- os: linux
|
||||
arch: arm64
|
||||
cgo: "0"
|
||||
cgo: '0'
|
||||
- os: windows
|
||||
arch: amd64
|
||||
cgo: "1"
|
||||
cgo: '1'
|
||||
- os: darwin
|
||||
arch: amd64
|
||||
cgo: "1"
|
||||
cgo: '1'
|
||||
- os: darwin
|
||||
arch: arm64
|
||||
cgo: "0"
|
||||
cgo: '0'
|
||||
|
||||
tasks:
|
||||
build-all:
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Releasing
|
||||
description: Task release process including GoReleaser, Homebrew, npm, Snapcraft, winget, and other package managers
|
||||
description:
|
||||
Task release process including GoReleaser, Homebrew, npm, Snapcraft, winget,
|
||||
and other package managers
|
||||
outline: deep
|
||||
---
|
||||
|
||||
@@ -67,5 +69,6 @@ If you think its Task version is outdated, open an issue to let us know.
|
||||
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb
|
||||
[packagejson]: https://github.com/go-task/task/blob/main/package.json#L3
|
||||
[snappackage]: https://github.com/go-task/snap
|
||||
[snapcraftyaml]: https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
|
||||
[snapcraftyaml]:
|
||||
https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
|
||||
[snapcraftdashboard]: https://snapcraft.io/task/releases
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Style Guide
|
||||
description: Official style guide for Taskfile.yml files with best practices and recommended conventions
|
||||
description:
|
||||
Official style guide for Taskfile.yml files with best practices and
|
||||
recommended conventions
|
||||
outline: deep
|
||||
---
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Taskfile Versions
|
||||
description: How to use the Taskfile schema version to ensure users are using the correct versions of Task
|
||||
description:
|
||||
How to use the Taskfile schema version to ensure users are using the correct
|
||||
versions of Task
|
||||
outline: deep
|
||||
---
|
||||
|
||||
|
@@ -35,11 +35,12 @@ the file tree until it finds one (similar to how `git` works). When running Task
|
||||
from a subdirectory like this, it will behave as if you ran it from the
|
||||
directory containing the Taskfile.
|
||||
|
||||
You can use this functionality along with the special <span v-pre>`{{.USER_WORKING_DIR}}`</span>
|
||||
variable to create some very useful reusable tasks. For example, if you have a
|
||||
monorepo with directories for each microservice, you can `cd` into a
|
||||
microservice directory and run a task command to bring it up without having to
|
||||
create multiple tasks or Taskfiles with identical content. For example:
|
||||
You can use this functionality along with the special
|
||||
<span v-pre>`{{.USER_WORKING_DIR}}`</span> variable to create some very useful
|
||||
reusable tasks. For example, if you have a monorepo with directories for each
|
||||
microservice, you can `cd` into a microservice directory and run a task command
|
||||
to bring it up without having to create multiple tasks or Taskfiles with
|
||||
identical content. For example:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@@ -70,9 +71,9 @@ This is useful to have automation that you can run from anywhere in your system!
|
||||
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 <span v-pre>`{{.USER_WORKING_DIR}}`</span> special
|
||||
variable can be very handy here to run stuff on the directory you're calling
|
||||
`task -g` from.
|
||||
As mentioned in the previous section, the
|
||||
<span v-pre>`{{.USER_WORKING_DIR}}`</span> special variable can be very handy
|
||||
here to run stuff on the directory you're calling `task -g` from.
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@@ -159,7 +160,6 @@ ENDPOINT=testing.com
|
||||
|
||||
:::
|
||||
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
@@ -306,8 +306,9 @@ includes:
|
||||
|
||||
### Flatten includes
|
||||
|
||||
You can flatten the included Taskfile tasks into the main Taskfile by using the `flatten` option.
|
||||
It means that the included Taskfile tasks will be available without the namespace.
|
||||
You can flatten the included Taskfile tasks into the main Taskfile by using the
|
||||
`flatten` option. It means that the included Taskfile tasks will be available
|
||||
without the namespace.
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -347,7 +348,8 @@ task: Available tasks for this project:
|
||||
|
||||
You can run `task foo` directly without the namespace.
|
||||
|
||||
You can also reference the task in other tasks without the namespace. So if you run `task greet` it will run `greet` and `foo` tasks and the output will be :
|
||||
You can also reference the task in other tasks without the namespace. So if you
|
||||
run `task greet` it will run `greet` and `foo` tasks and the output will be :
|
||||
|
||||
```text
|
||||
Greet
|
||||
@@ -384,18 +386,21 @@ tasks:
|
||||
:::
|
||||
|
||||
If you run `task -a` it will print:
|
||||
|
||||
```text
|
||||
task: Found multiple tasks (greet) included by "lib"
|
||||
```
|
||||
|
||||
If the included Taskfile has a task with the same name as a task in the main Taskfile,
|
||||
you may want to exclude it from the flattened tasks.
|
||||
If the included Taskfile has a task with the same name as a task in the main
|
||||
Taskfile, you may want to exclude it from the flattened tasks.
|
||||
|
||||
You can do this by using the [`excludes` option](#exclude-tasks-from-being-included).
|
||||
You can do this by using the
|
||||
[`excludes` option](#exclude-tasks-from-being-included).
|
||||
|
||||
### Exclude tasks from being included
|
||||
|
||||
You can exclude tasks from being included by using the `excludes` option. This option takes the list of tasks to be excluded from this include.
|
||||
You can exclude tasks from being included by using the `excludes` option. This
|
||||
option takes the list of tasks to be excluded from this include.
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -417,7 +422,8 @@ tasks:
|
||||
|
||||
:::
|
||||
|
||||
`task included:foo` will throw an error because the `foo` task is excluded but `task included:bar` will work and display `Bar`.
|
||||
`task included:foo` will throw an error because the `foo` task is excluded but
|
||||
`task included:bar` will work and display `Bar`.
|
||||
|
||||
It's compatible with the `flatten` option.
|
||||
|
||||
@@ -880,12 +886,14 @@ tasks that generate remote artifacts (Docker images, deploys, CD releases) the
|
||||
checksum source and timestamps require either access to the artifact or for an
|
||||
out-of-band refresh of the `.checksum` fingerprint file.
|
||||
|
||||
Two special variables <span v-pre>`{{.CHECKSUM}}`</span> and <span v-pre>`{{.TIMESTAMP}}`</span> are available for
|
||||
interpolation within `cmds` and `status` commands, depending on the method assigned to
|
||||
fingerprint the sources. Only `source` globs are fingerprinted.
|
||||
Two special variables <span v-pre>`{{.CHECKSUM}}`</span> and
|
||||
<span v-pre>`{{.TIMESTAMP}}`</span> are available for interpolation within
|
||||
`cmds` and `status` commands, depending on the method assigned to fingerprint
|
||||
the sources. Only `source` globs are fingerprinted.
|
||||
|
||||
Note that the <span v-pre>`{{.TIMESTAMP}}`</span> variable is a "live" Go `time.Time` struct, and
|
||||
can be formatted using any of the methods that `time.Time` responds to.
|
||||
Note that the <span v-pre>`{{.TIMESTAMP}}`</span> variable is a "live" Go
|
||||
`time.Time` struct, and can be formatted using any of the methods that
|
||||
`time.Time` responds to.
|
||||
|
||||
See [the Go Time documentation](https://golang.org/pkg/time/) for more
|
||||
information.
|
||||
@@ -893,8 +901,9 @@ information.
|
||||
You can use `--force` or `-f` if you want to force a task to run even when
|
||||
up-to-date.
|
||||
|
||||
Also, `task --status [tasks]...` will exit with a non-zero [exit
|
||||
code](/reference/cli.md#exit-codes) if any of the tasks are not up-to-date.
|
||||
Also, `task --status [tasks]...` will exit with a non-zero
|
||||
[exit code](/reference/cli.md#exit-codes) if any of the tasks are not
|
||||
up-to-date.
|
||||
|
||||
`status` can be combined with the
|
||||
[fingerprinting](#by-fingerprinting-locally-generated-files-and-their-sources)
|
||||
@@ -1057,11 +1066,16 @@ tasks:
|
||||
|
||||
### Ensuring required variables have allowed values
|
||||
|
||||
If you want to ensure that a variable is set to one of a predefined set of valid values before executing a task, you can use requires.
|
||||
This is particularly useful when there are strict requirements for what values a variable can take, and you want to provide clear feedback to the user when an invalid value is detected.
|
||||
If you want to ensure that a variable is set to one of a predefined set of valid
|
||||
values before executing a task, you can use requires. This is particularly
|
||||
useful when there are strict requirements for what values a variable can take,
|
||||
and you want to provide clear feedback to the user when an invalid value is
|
||||
detected.
|
||||
|
||||
To use `requires`, you specify an array of allowed values in the vars sub-section under requires. Task will check if the variable is set to one of the allowed values.
|
||||
If the variable does not match any of these values, the task will raise an error and stop execution.
|
||||
To use `requires`, you specify an array of allowed values in the vars
|
||||
sub-section under requires. Task will check if the variable is set to one of the
|
||||
allowed values. If the variable does not match any of these values, the task
|
||||
will raise an error and stop execution.
|
||||
|
||||
This check applies both to user-defined variables and environment variables.
|
||||
|
||||
@@ -1119,7 +1133,7 @@ tasks:
|
||||
FLOAT: 3.14
|
||||
ARRAY: [1, 2, 3]
|
||||
MAP:
|
||||
map: {A: 1, B: 2, C: 3}
|
||||
map: { A: 1, B: 2, C: 3 }
|
||||
cmds:
|
||||
- 'echo {{.STRING}}' # Hello, World!
|
||||
- 'echo {{.BOOL}}' # true
|
||||
@@ -1199,7 +1213,7 @@ version: '3'
|
||||
|
||||
tasks:
|
||||
greet_user:
|
||||
desc: "Greet the user with a name."
|
||||
desc: 'Greet the user with a name.'
|
||||
vars:
|
||||
USER_NAME: '{{.USER_NAME| default "DefaultUser"}}'
|
||||
cmds:
|
||||
@@ -1237,10 +1251,10 @@ This works for all types of variables.
|
||||
|
||||
### Referencing other variables
|
||||
|
||||
Templating is great for referencing string values if you want to pass
|
||||
a value from one task to another. However, the templating engine is only able to
|
||||
output strings. If you want to pass something other than a string to another
|
||||
task then you will need to use a reference (`ref`) instead.
|
||||
Templating is great for referencing string values if you want to pass a value
|
||||
from one task to another. However, the templating engine is only able to output
|
||||
strings. If you want to pass something other than a string to another task then
|
||||
you will need to use a reference (`ref`) instead.
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -1279,8 +1293,8 @@ tasks:
|
||||
|
||||
:::
|
||||
|
||||
This also works the same way when calling `deps` and when defining
|
||||
a variable and can be used in any combination:
|
||||
This also works the same way when calling `deps` and when defining a variable
|
||||
and can be used in any combination:
|
||||
|
||||
```yaml
|
||||
version: 3
|
||||
@@ -1337,7 +1351,7 @@ tasks:
|
||||
vars:
|
||||
JSON: '{"a": 1, "b": 2, "c": 3}'
|
||||
FOO:
|
||||
ref: "fromJson .JSON"
|
||||
ref: 'fromJson .JSON'
|
||||
cmds:
|
||||
- echo {{.FOO}}
|
||||
```
|
||||
@@ -1382,9 +1396,11 @@ tasks:
|
||||
cmds:
|
||||
- for:
|
||||
matrix:
|
||||
OS: ["windows", "linux", "darwin"]
|
||||
ARCH: ["amd64", "arm64"]
|
||||
cmd: echo "<span v-pre>{{.ITEM.OS}}</span>/<span v-pre>{{.ITEM.ARCH}}</span>"
|
||||
OS: ['windows', 'linux', 'darwin']
|
||||
ARCH: ['amd64', 'arm64']
|
||||
cmd:
|
||||
echo "<span v-pre>{{.ITEM.OS}}</span>/<span
|
||||
v-pre>{{.ITEM.ARCH}}</span>"
|
||||
```
|
||||
|
||||
This will output:
|
||||
@@ -1401,11 +1417,11 @@ darwin/arm64
|
||||
You can also use references to other variables as long as they are also lists:
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
OS_VAR: ["windows", "linux", "darwin"]
|
||||
ARCH_VAR: ["amd64", "arm64"]
|
||||
OS_VAR: ['windows', 'linux', 'darwin']
|
||||
ARCH_VAR: ['amd64', 'arm64']
|
||||
|
||||
tasks:
|
||||
default:
|
||||
@@ -1416,7 +1432,9 @@ tasks:
|
||||
ref: .OS_VAR
|
||||
ARCH:
|
||||
ref: .ARCH_VAR
|
||||
cmd: echo "<span v-pre>{{.ITEM.OS}}</span>/<span v-pre>{{.ITEM.ARCH}}</span>"
|
||||
cmd:
|
||||
echo "<span v-pre>{{.ITEM.OS}}</span>/<span
|
||||
v-pre>{{.ITEM.ARCH}}</span>"
|
||||
```
|
||||
|
||||
### Looping over your task's sources or generated files
|
||||
@@ -1460,9 +1478,9 @@ files that match that glob.
|
||||
|
||||
Paths will always be returned as paths relative to the task directory. If you
|
||||
need to convert this to an absolute path, you can use the built-in `joinPath`
|
||||
function. There are some [special
|
||||
variables](/reference/templating#special-variables) that you may find useful
|
||||
for this.
|
||||
function. There are some
|
||||
[special variables](/reference/templating#special-variables) that you may find
|
||||
useful for this.
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -1548,9 +1566,9 @@ tasks:
|
||||
cmd: echo <span v-pre>{{.ITEM}}</span>
|
||||
```
|
||||
|
||||
When looping over a map we also make an additional <span v-pre>`{{.KEY}}`</span> variable available
|
||||
that holds the string value of the map key. Remember that maps are unordered, so
|
||||
the order in which the items are looped over is random.
|
||||
When looping over a map we also make an additional <span v-pre>`{{.KEY}}`</span>
|
||||
variable available that holds the string value of the map key. Remember that
|
||||
maps are unordered, so the order in which the items are looped over is random.
|
||||
|
||||
All of this also works with dynamic variables!
|
||||
|
||||
@@ -1701,14 +1719,15 @@ version: '3'
|
||||
tasks:
|
||||
start:*:*:
|
||||
vars:
|
||||
SERVICE: "<span v-pre>{{index .MATCH 0}}</span>"
|
||||
REPLICAS: "<span v-pre>{{index .MATCH 1}}</span>"
|
||||
SERVICE: '<span v-pre>{{index .MATCH 0}}</span>'
|
||||
REPLICAS: '<span v-pre>{{index .MATCH 1}}</span>'
|
||||
cmds:
|
||||
- echo "Starting <span v-pre>{{.SERVICE}}</span> with <span v-pre>{{.REPLICAS}}</span> replicas"
|
||||
- echo "Starting <span v-pre>{{.SERVICE}}</span> with <span
|
||||
v-pre>{{.REPLICAS}}</span> replicas"
|
||||
|
||||
start:*:
|
||||
vars:
|
||||
SERVICE: "<span v-pre>{{index .MATCH 0}}</span>"
|
||||
SERVICE: '<span v-pre>{{index .MATCH 0}}</span>'
|
||||
cmds:
|
||||
- echo "Starting <span v-pre>{{.SERVICE}}</span>"
|
||||
```
|
||||
@@ -1792,7 +1811,10 @@ version: '3'
|
||||
tasks:
|
||||
default:
|
||||
cmds:
|
||||
- defer: echo '<span v-pre>{{if .EXIT_CODE}}</span>Failed with <span v-pre>{{.EXIT_CODE}}</span>!<span v-pre>{{else}}</span>Success!<span v-pre>{{end}}</span>'
|
||||
- defer:
|
||||
echo '<span v-pre>{{if .EXIT_CODE}}</span>Failed with <span
|
||||
v-pre>{{.EXIT_CODE}}</span>!<span v-pre>{{else}}</span>Success!<span
|
||||
v-pre>{{end}}</span>'
|
||||
- exit 1
|
||||
```
|
||||
|
||||
@@ -2322,9 +2344,9 @@ which files to watch.
|
||||
|
||||
The default watch interval is 100 milliseconds, but it's possible to change it
|
||||
by either setting `interval: '500ms'` in the root of the Taskfile or by passing
|
||||
it as an argument like `--interval=500ms`.
|
||||
This interval is the time Task will wait for duplicated events. It will only run
|
||||
the task again once, even if multiple changes happen within the interval.
|
||||
it as an argument like `--interval=500ms`. This interval is the time Task will
|
||||
wait for duplicated events. It will only run the task again once, even if
|
||||
multiple changes happen within the interval.
|
||||
|
||||
Also, it's possible to set `watch: true` in a given task and it'll automatically
|
||||
run in watch mode:
|
||||
@@ -2355,10 +2377,9 @@ if called by another task, either directly or as a dependency.
|
||||
::: warning
|
||||
|
||||
The watcher can misbehave in certain scenarios, in particular for long-running
|
||||
servers.
|
||||
There is a known bug where child processes of the running might not be killed
|
||||
appropriately. It's advised to avoid running commands as `go run` and prefer
|
||||
`go build [...] && ./binary` instead.
|
||||
servers. There is a known bug where child processes of the running might not be
|
||||
killed appropriately. It's advised to avoid running commands as `go run` and
|
||||
prefer `go build [...] && ./binary` instead.
|
||||
|
||||
If you are having issues, you might want to try tools specifically designed for
|
||||
live-reloading, like [Air](https://github.com/air-verse/air/). Also, be sure to
|
||||
|
@@ -8,23 +8,24 @@ outline: false
|
||||
|
||||
If you find this project useful, consider supporting its ongoing development.
|
||||
|
||||
> This is just a way to say **“thank you”** — donations won’t provide priority support or special privileges.
|
||||
|
||||
> This is just a way to say **“thank you”** — donations won’t provide priority
|
||||
> support or special privileges.
|
||||
|
||||
## 🏆 Gold Sponsorship
|
||||
|
||||
Companies donating **$50/month or more** can become a **Gold Sponsor**, featured on:
|
||||
Companies donating **$50/month or more** can become a **Gold Sponsor**, featured
|
||||
on:
|
||||
|
||||
- The website homepage
|
||||
- The GitHub repository README
|
||||
|
||||
> 💬 To be featured, contact [@andreynering] with your logo.
|
||||
> ⚠️ Suspicious or inappropriate businesses (e.g. gambling, casinos) will be rejected.
|
||||
> 💬 To be featured, contact [@andreynering] with your logo. ⚠️ Suspicious or
|
||||
> inappropriate businesses (e.g. gambling, casinos) will be rejected.
|
||||
|
||||
## ❤️ GitHub Sponsors _(recommended)_
|
||||
|
||||
## ❤️ GitHub Sponsors *(recommended)*
|
||||
|
||||
The preferred way to donate is through **GitHub Sponsors**.
|
||||
We suggest splitting your donation equally between maintainers:
|
||||
The preferred way to donate is through **GitHub Sponsors**. We suggest splitting
|
||||
your donation equally between maintainers:
|
||||
|
||||
<div style="display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0;">
|
||||
<a href="https://github.com/sponsors/andreynering" target="_blank">
|
||||
@@ -38,7 +39,6 @@ We suggest splitting your donation equally between maintainers:
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
## 🌐 Open Collective
|
||||
|
||||
Prefer **Open Collective**? Choose a tier:
|
||||
@@ -49,19 +49,16 @@ Prefer **Open Collective**? Choose a tier:
|
||||
- [$50/month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
|
||||
- [🎯 Custom / One-time](https://opencollective.com/task/donate)
|
||||
|
||||
|
||||
## 💳 PayPal
|
||||
|
||||
You can also make a **one-time donation** to @andreynering via PayPal:
|
||||
|
||||
[Donate via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A¤cy_code=USD&source=url)
|
||||
|
||||
|
||||
## 🇧🇷 PIX (Brazil only)
|
||||
|
||||
If you're in Brazil, you can also support @andreynering via PIX:
|
||||
|
||||
<img src="/img/pix.png" width="200" height="200" alt="PIX QR Code" />
|
||||
|
||||
|
||||
Thank you for helping Taskfile grow and stay maintained! 💚
|
||||
|
@@ -3,7 +3,9 @@ layout: home
|
||||
hero:
|
||||
name: Task
|
||||
text: The Modern Task Runner
|
||||
tagline: A fast, cross-platform build tool inspired by Make, designed for modern workflows.
|
||||
tagline:
|
||||
A fast, cross-platform build tool inspired by Make, designed for modern
|
||||
workflows.
|
||||
image:
|
||||
src: /img/logo.png
|
||||
alt: Task logo
|
||||
@@ -18,22 +20,29 @@ hero:
|
||||
text: CLI
|
||||
link: /reference/cli
|
||||
|
||||
|
||||
features:
|
||||
- title: 30-Second Setup
|
||||
details: Single binary download, zero dependencies. Works with Homebrew, Snapcraft, Scoop and more.
|
||||
details:
|
||||
Single binary download, zero dependencies. Works with Homebrew, Snapcraft,
|
||||
Scoop and more.
|
||||
icon: 🚀
|
||||
|
||||
- title: Truly cross-platform
|
||||
icon: 🖥️
|
||||
details: Run the same Taskfile on Linux, macOS and Windows. No extra setup. Task handles platform quirks so you don’t have to.
|
||||
details:
|
||||
Run the same Taskfile on Linux, macOS and Windows. No extra setup. Task
|
||||
handles platform quirks so you don’t have to.
|
||||
|
||||
- title: Smart Caching
|
||||
icon: 🎯
|
||||
details: Skip unnecessary rebuilds by tracking file changes (timestamp or content-based).
|
||||
details:
|
||||
Skip unnecessary rebuilds by tracking file changes (timestamp or
|
||||
content-based).
|
||||
|
||||
- title: Ideal for code generation & scaffolding
|
||||
icon: ⚡
|
||||
details: Use Task to wire up codegen tools, formatters, linters, or anything repetitive. Chain commands, set dependencies, and keep your workflow clean.
|
||||
details:
|
||||
Use Task to wire up codegen tools, formatters, linters, or anything
|
||||
repetitive. Chain commands, set dependencies, and keep your workflow
|
||||
clean.
|
||||
---
|
||||
|
||||
|
@@ -276,7 +276,14 @@
|
||||
"^.*$": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": ["boolean", "integer", "null", "number", "string", "array"]
|
||||
"type": [
|
||||
"boolean",
|
||||
"integer",
|
||||
"null",
|
||||
"number",
|
||||
"string",
|
||||
"array"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/var_subkey"
|
||||
@@ -416,10 +423,7 @@
|
||||
"$ref": "#/definitions/platforms"
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{"required": ["cmd"]},
|
||||
{"required": ["task"]}
|
||||
],
|
||||
"oneOf": [{ "required": ["cmd"] }, { "required": ["task"] }],
|
||||
"additionalProperties": false,
|
||||
"required": ["for"]
|
||||
},
|
||||
@@ -442,10 +446,7 @@
|
||||
"$ref": "#/definitions/vars"
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{"required": ["cmd"]},
|
||||
{"required": ["task"]}
|
||||
],
|
||||
"oneOf": [{ "required": ["cmd"] }, { "required": ["task"] }],
|
||||
"additionalProperties": false,
|
||||
"required": ["for"]
|
||||
},
|
||||
@@ -592,8 +593,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"enum": { "type": "array",
|
||||
"items": { "type": "string" } }
|
||||
"enum": { "type": "array", "items": { "type": "string" } }
|
||||
},
|
||||
"required": ["name", "enum"],
|
||||
"additionalProperties": false
|
||||
|
@@ -1,6 +1,7 @@
|
||||
---
|
||||
layout: page
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
VPTeamPage,
|
||||
|
@@ -16,11 +16,6 @@
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": [
|
||||
".vitepress/**/*",
|
||||
"**/*.vue",
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
],
|
||||
"include": [".vitepress/**/*", "**/*.vue", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
Reference in New Issue
Block a user