1
0
mirror of https://github.com/go-task/task.git synced 2024-12-04 10:24:45 +02:00
Commit Graph

150 Commits

Author SHA1 Message Date
Misite Bao
15ef1fa1c2
Make --init generate .yml instead of .yaml (#1062) 2023-03-16 21:53:01 -03:00
Andrey Nering
f2114f09f7 Fix capitalization of flags descriptions on task -h
Also, adds missing periods.
2023-03-08 23:24:39 -03:00
Andrey Nering
9c844850e4
Add --global (-g) flag (#1029)
This will run a Taskfile from the home directory, i.e., `$HOME/Taskfile.yml`.
2023-03-08 23:21:23 -03:00
Dennis Jekubczyk
88d644a7e9
Add ability to set error_only: true on the group output mode 2023-03-08 22:34:52 -03:00
Pete Davison
d4ed7c3cfc
Merge pull request #1004 from go-task/semver
feat: use semver package for taskfile schema version
2023-03-02 19:07:52 +00:00
João Pedro
ec2110e58f Add new TASK_VERSION special variable
Closes #1014
Closes #990
2023-02-22 22:08:38 -03:00
Pete Davison
8b72c86ba5 feat: use semver package for taskfile schema version 2023-02-10 18:14:38 +00:00
Pete Davison
796097e3ab
fix: watch interval (#970) 2022-12-31 13:48:49 -03:00
Andrey Nering
a98b41d657 Add goimports as a linter 2022-12-17 11:02:17 -03:00
David Alpert
321f7b59d8
Add --json flag to be used by editor extensions (#936) 2022-12-17 10:31:00 -03:00
Pete Davison
fa105a8a93 refactor: implement task list filtering 2022-11-02 14:42:59 +00:00
Andrey Nering
99014ad38d Small adjustments + CHANGELOG for #865 2022-10-14 16:51:14 -03:00
ilewin
1c44d8049a Issue 813. Made watch interval configurable through global setting in Taskfile and through CLI arg.
Separated Taskfile param and Arg flag
2022-09-19 20:14:35 +02:00
Gerd Aschemann
475c5dc19a Add -n as short cut for --dry - solves #776 2022-06-13 12:47:03 +02:00
Andrey Nering
7989f73f06 Fix behavior of interrupt (SIGINT, SIGTERM) signals
Task will now give time for the processes running to do cleanup work

Ref #458
Ref #479
Fixes #728

Co-authored-by: Marco Molteni <marco.molteni@pix4d.com>
Co-authored-by: aliculPix4D <aleksandar.licul_ext@pix4d.com>
2022-06-11 22:43:22 -03:00
Andrey Nering
c9a582fbcc Add CHANGELOG, documentation and make small adjutsment for #755 2022-06-11 20:01:48 -03:00
Bruno Delor
752d9d5316 Renames option to align with existing tools
Shorthand: -x
Longhand: --exit-code
2022-06-06 09:46:27 +02:00
Bruno Delor
a790fb7afe Adds --carry flag to enable carrying error codes from task cmds 2022-06-02 14:22:00 +02:00
ardnew
9897f4b527
refactor with support for --list and --list-all 2022-03-21 12:59:25 -05:00
ardnew
978a6e5ecb
quickly print task names only with flags --silent and --list 2022-03-21 12:02:56 -05:00
Andrey Nering
b323531dd5 Improvements and CHANGELOG for #651 2022-02-19 19:31:27 -03:00
Jay Anslow
74f5cf8f29
Add support for begin/end messages with grouped output
Fixes #647

This allows CI systems that support grouping (such as with [GitHub Actions's `::group::` command](https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#grouping-log-lines) and [Azure Devops](https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#formatting-commands)) to collapse all of the logs for a single task, to improve readability of logs

## Example

The following Taskfile

```
# Taskfile.yml
version: 3
output:
  group:
    begin: "::group::{{ .TASK }}"
    end: "::endgroup::"
tasks:
  default:
    cmds:
      - "echo 'Hello, World!'"
```

Results in the following output
```bash
$ task
task: [default] echo 'Hello, World!'
::group::default
Hello, World!
::endgroup::
```

See [this GitHub Actions job](https://github.com/janslow/task/runs/4811059609?check_suite_focus=true) for a full example

<img width="771" alt="image" src="https://user-images.githubusercontent.com/1253367/149429832-6cb0c1b5-0758-442e-9375-c4daa65771bc.png">
<img width="394" alt="image" src="https://user-images.githubusercontent.com/1253367/149429851-1d5d2ab5-9095-4795-9b57-f91750720d40.png">
2022-01-14 00:22:14 +00:00
Andrey Nering
7e0346d6eb Add CHANGELOG, documentation and small improvements to #401 2022-01-04 17:16:21 -03:00
Andrey Nering
00a90d1fe6 Merge branch 'f/list-all' of https://github.com/therealkevinard/task into therealkevinard-f/list-all 2022-01-04 17:03:12 -03:00
Kevin Ard
42702e81b3 refactor: wrap PrintTasksHelp with arg-less signatures
provide exported methods for accessing PrintTasksHelp variants.
2022-01-03 12:12:18 -05:00
Margus Kerma
1d7982e80a fix(#584): Add support to yaml extension
- init creates Taskfile.yaml
- add changelog entry
- add zsh completion support for Taskfile.yaml
2022-01-02 15:23:10 +02:00
Andrey Nering
4e1f2ad017 Enforce NO_COLOR=1 on tests to make sure it passes
Closes #459
Fixes #480
Ref #343
Ref fatih/color#137
2021-05-30 22:48:48 -03:00
Andrey Nering
05ddfc0495
Merge pull request #476 from Pix4D/fix-os-kill
signals: do not try to catch uncatchable signals
2021-04-23 17:45:56 -03:00
Andrey Nering
53b2cebb66 Updated the version output to use Go module build information if avalable. Enabled GoReleaser module proxying for verifiable builds.
Co-authored-by: Jamie Edge <JamieEdge@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-04-23 17:35:15 -03:00
Marco Molteni
837fb71a24 signals: do not try to catch uncatchable signals
os.Kill is SIGKILL (kill -9), cannot be intercepted.
(see https://github.com/golang/go/issues/13080)
2021-04-20 14:57:23 +02:00
Andrey Nering
e79354a039 Revert "Updated the version output to use Go module build information if available. Enabled GoReleaser module proxying for verifiable builds."
This reverts commit 2a3f049336.
2021-04-17 17:47:24 -03:00
Andrey Nering
ec8b1403bd Use early return and add CHANGELOG for #462 2021-04-04 15:40:34 -03:00
Jamie Edge
2a3f049336 Updated the version output to use Go module build information if available. Enabled GoReleaser module proxying for verifiable builds. 2021-04-04 12:57:58 +01:00
Andrey Nering
e6c4706b73 Add support for delegating CLI arguments with "--" and a special CLI_ARGS variable
Closes #327
2021-03-20 11:58:45 -03:00
Ross Hammermeister
c6ecf70377 Adding a --concurrency (-C) flag 2021-03-07 09:49:57 -03:00
Andrey Nering
83d25bfa00 Refactor: Fix import order
It should be: stdlib > libs > app
2021-01-07 11:48:33 -03:00
Kevin Ard
9bed7f7a9b feat (help): allow cli option to list tasks with no desc
added an add'l cli option that lists all tasks, with or without description.
orig. behavior: task -l lists tasks with desc field
new behaviour: task -la or task -a will list all tasks. if task has desc, it will be included.

BREAKING CHANGES: none, that I know of.
NOTES/Concerns:
- This is wip.
- Haven't checked how it interacts with bash completion.
- The new Executor.TaskNames func does not use e.CompiledTask(taskfile.Call{Task: task.Task})
2020-11-13 15:27:03 -05:00
Damian Szulc
47dd9b5a03 Move args and taskfile packages to root directory 2020-08-19 10:59:58 +02:00
Andrey Nering
6ff3c9015b On v3, treat all CLI variables as global variables
Closes #336
Ref #341

Co-authored-by: Egor Kovetskiy <e.kovetskiy@gmail.com>
2020-08-16 21:27:11 -03:00
Andrey Nering
fb72b46a3c github.com/go-task/task/v2 -> github.com/go-task/task/v3 2020-08-16 15:48:19 -03:00
Andrey Nering
4913b6a0f1 Merge branch 'v3' into vars-refactor-for-v3 2020-05-16 11:18:28 -03:00
Andrey Nering
aee0ab05f4 Merge branch 'master' into v3 2020-05-16 10:28:00 -03:00
Andrey Nering
86be13ff1f
Merge pull request #330 from danquah/print-usage
Have the --help/-h flag print usage.
2020-05-14 21:15:00 -03:00
Mads H. Danquah
739037fc37 Have the --help/-h flag print usage.
pflag will output a "pflag: help requested" message after displaying the usage
if we don't explicitly  handle the flag.
2020-05-14 21:58:46 +02:00
Mads H. Danquah
f8252020aa Switch to printing the version string to std out 2020-05-14 21:40:49 +02:00
Andrey Nering
6ed30f1add Refactor variables: Keep order of declaration
This shouldn't have any behavior changes for now. This is a code
refactor that should allow us to do further improvements on how
variables are handled, specially regarding respecting the declaration
order in Taskfiles, which should make it easier for the users.

Initial work on #218
2020-04-05 11:16:14 -03:00
Andrey Nering
acfbbaa549 Merge branch 'master' into v3 2020-03-28 10:48:49 -03:00
Andrey Nering
c068b05232
Delete taskfile.org -> taskfile.dev redirect code
This has been migrated to Netlify
2019-12-23 22:25:19 -03:00
Andrey Nering
d718527a1f Merge branch 'master' into v3 2019-12-07 16:54:29 -03:00
Andrey Nering
a4685229c9 Fix bug of Task not executing the "default" task
When global vars were informed using the CLI.

I took the oportunity to move this logic to the proper package and
write a test.
2019-12-07 16:20:36 -03:00
Andrey Nering
62752ba7e1 Merge branch 'master' into v3 2019-11-24 21:02:33 -03:00
Ross Hammermeister
27bc1ca5d1 Add flag to allow tasks provided on the command line to be run in parallel 2019-11-13 13:50:04 -07:00
Andrey Nering
d6a49da870 Merge branch 'master' into v3 2019-09-08 22:12:02 -03:00
Andrey Nering
0e1d8a72e6 Revert "Ensure the $HOME env is being set on Windows"
This reverts commit 52028fc3bc.
2019-09-08 21:56:23 -03:00
Andrey Nering
7138785500 Merge branch 'master' into v3 2019-09-07 14:44:21 -03:00
Andrey Nering
52028fc3bc Ensure the $HOME env is being set on Windows 2019-09-07 14:29:13 -03:00
jaedle
5a6fb7c973
Bump version of taskfile
Co-Authored-By: Andrey Nering <andrey.nering@gmail.com>
2019-08-19 20:53:20 +02:00
jaedle
0f385f9f4e remove v1 2019-08-18 17:37:21 +02:00
Andrey Nering
d5a791b470 Merge branch 'master' into v3 2019-08-11 23:03:58 -03:00
Andrey Nering
d970e93507 Add --taskfile flag (alias -t) to allow running another Taskfile
Closes #221
2019-07-21 10:57:04 -03:00
Andrey Nering
0e575e9c25 Add --color=false flag to disable colored output 2019-07-07 14:13:53 -03:00
Andrey Nering
8efc38ad82 Use colors for some output messages 2019-05-26 18:36:39 -03:00
Andrey Nering
f0768b3af1 Allow setting global variables through the CLI
Closes #192
2019-05-11 11:06:47 -03:00
Andrey Nering
e81e2802f0 Small fix to redirector 2019-03-23 17:48:18 -03:00
Andrey Nering
9f269e1a95 Migrating from taskfile.org to taskfile.dev 2019-03-04 23:23:30 -03:00
jaedle
06d0af7a1d rename details in Executor to summary 2019-02-24 15:33:09 +01:00
jaedle
9a3b726068 change help to summary 2019-02-24 15:32:24 +01:00
jaedle
2676ab9a59 renamed program flag to summary 2019-02-24 15:31:46 +01:00
jaedle
13614fb3c4 add details flag for cli 2019-02-24 08:51:20 +01:00
Andrey Nering
713ecd35f6 Pass context as an argument 2019-02-09 10:16:13 -02:00
kj
a026d72924 Add execute output style options 2019-02-05 15:42:57 +09:00
Andrey Nering
3cbc89769d Re-write import paths to v2 2018-11-04 21:23:35 -02:00
Andrey Nering
b65a0a3a8d Fix signal handling when --watch flag is given
Closes #132
2018-09-16 21:59:00 -03:00
Andrey Nering
a5f31a4280 Dry run small code style changes 2018-08-05 11:28:02 -03:00
Josh Bebbington
3f7e8c88eb Changed --dry-run flag to --dry 2018-07-29 22:03:22 +01:00
Josh Bebbington
1c7ca94d49 Implemented dry run mode
Added a --dry-run flag that compiles and steps through each task, but does not execute them. The commands that would have been run are printed. See #125.
2018-07-29 00:39:25 +01:00
Andrey Nering
120d0be84c Fixes panic on task --list
Fixes #99
2018-03-11 14:39:40 -03:00
Andrey Nering
78f6cb08d8 Add --status flag to check is a task is up-to-date
Closes #81
2017-12-26 21:43:52 -02:00
Andrey Nering
71e7cd5808 listening for SIGINT and SIGTERM
closes #75
2017-11-19 18:33:57 -02:00
Andrey Nering
33b167215d move some packages to the "internal" directory
- this makes it impossible to import these packages outside Task
- as a side effect, it makes the root directory cleaner
2017-10-15 17:58:21 -02:00
Andrey Nering
f3097845b4 allow assigning variables to tasks at run time via CLI
using a similar syntax than setting env variables to command in bash,
but used right after the task:

```bash
task print MESSAGE=Hello!
```

closes #33
2017-09-07 13:57:06 -03:00
Andrey Nering
bb1aff84cf custom stdout for InitTaskfile func 2017-07-30 19:29:49 -03:00
Andrey Nering
7077b20a54 flag to set directory of execution 2017-07-30 19:24:53 -03:00
Andrey Nering
d0b37df615 add silent mode to disable echoing of commands 2017-07-19 20:20:24 -03:00
Andrey Nering
998935ea55 add --list (or -l) flag to print existing tasks
If an inexixtent task is given, the help also prints as before

Also fixing README documentation

Closes #51
2017-07-15 14:10:46 -03:00
Sindre Røkenes Myren
774ef61c2f Update usage text slightly 2017-07-06 18:40:01 +02:00
Andrey Nering
222b5cb587 add verbose mode (-v flag) 2017-07-05 20:56:31 -03:00
Sindre Røkenes Myren
023a902f61 Improve task command help text 2017-07-03 15:05:19 +02:00
Andrey Nering
ecfd8e8a62 change all tests to call functions instead of binary directly
I had to temporarely hack github.com/mvdan/sh to fix dir handling
2017-07-01 15:32:13 -03:00
Andrey Nering
9ba44f3e6e allow custom Stdin, Stdout and Stderr while running as a lib 2017-07-01 15:05:51 -03:00
Andrey Nering
685b9ae293 improvements on release process 2017-06-14 15:28:35 -03:00
Andrey Nering
f98bf6c4b1 refactor: Create executor struct to get rid of global variables
Maybe eventually help on #17
2017-06-04 16:02:04 -03:00
Andrey Nering
2615000609 Add --init flag to create a new Taskfile 2017-05-17 15:38:46 -03:00
Andrey Nering
72a6727e31 Watch task 2017-04-01 16:11:32 -03:00
Andrey Nering
f899df2e82 Use github.com/spf13/pflag instead of stdlib flag 2017-03-01 20:43:27 -03:00
Andrey Nering
131499b66d Add -f flag to force execution even when task is up-to-date 2017-03-01 20:21:36 -03:00
Andrey Nering
27a21eb4cb Fix extension on help text 2017-02-28 18:43:18 -03:00
Travis
a53fcf8bba add toml example, use yaml in help doc
Signed-off-by: Andrey Nering <andrey.nering@gmail.com>
2017-02-28 18:33:53 -03:00
Travis
61b1aa8559 added yml/json/toml support, --help flag, and example directory
Signed-off-by: Andrey Nering <andrey.nering@gmail.com>
2017-02-28 18:33:53 -03:00
Andrey Nering
a441fea849 Move main package to cmd/task 2017-02-27 09:48:50 -03:00