andreynering
andreynering
TTask
Created by Rots on 11/28/2024 in #help
Convert string variable to integer
Hi @Rots, Yes, take a look at this page: https://go-task.github.io/slim-sprig/conversion.html
3 replies
TTask
Created by dNaszta on 11/19/2024 in #help
Watching golang source w net/http server
Hi @dNaszta, Task's watcher is not 100% polished, so it may fail in some scenarios. I suggest you to try dedicated tools like Air (https://github.com/air-verse/air). Both tools can be used together.
4 replies
TTask
Created by noel on 11/14/2024 in #help
Rerun task on dep build.
Hi @noel, Perhaps you could paste a small example Taskfile on what exactly you're trying to do? What is preventing that task to run? Is it fingerprinting (via sources:) or are you using run: :once?
8 replies
TTask
Created by ibragdzh on 11/7/2024 in #help
Parentheses in commands
Looks like there's a leading $ in front of that string. I think it shouldn't be there.
9 replies
TTask
Created by ibragdzh on 11/7/2024 in #help
Parentheses in commands
Try to change echo \"{{.MIGRATION_FILE}}\" > $$FILENAME; to echo {{shellQuote .MIGRATION_FILE}} > $$FILENAME;
9 replies
TTask
Created by ibragdzh on 11/7/2024 in #help
Parentheses in commands
@ibragdzh This page has some explanation on how to declare multi-line string in YAML: https://yaml-multiline.info/ Using | is probably what you want.
9 replies
TTask
Created by ibragdzh on 11/7/2024 in #help
Parentheses in commands
@ibragdzh Can you paste that part of your Taskfile? It an YAML parse error, so it looks like simply wrapping your command into quotes would work.
9 replies
TTask
Created by HighDesertStorm on 10/19/2024 in #help
Is it possible to to specify a Go version in a Taskfile?
@HighDesertStorm Task certainly won't download Go for you. It's a generic task runner: it will basically just run the commands you've configured on your Taskfile.
5 replies
TTask
Created by HighDesertStorm on 10/19/2024 in #help
Is it possible to to specify a Go version in a Taskfile?
Hi @HighDesertStorm, Your Taskfile will call whatever go binary is available in your PATH. You can call go version to know its version. If you want a different version, you'll need to install it yourself.
5 replies
TTask
Created by trim21 on 10/10/2024 in #help
variable for current taskfile?
Hi @trim21, Take a look at the special variables, specially ROOT_DIR, TASKFILE_DIR and USER_WORKING_DIR. https://taskfile.dev/reference/templating/#special-variables
3 replies
TTask
Created by snowe on 10/9/2024 in #help
Does precondition support go templates?
Hi @snowe, This is an YAML parse error. You need to wrap your precondition into quotes.
7 replies
TTask
Created by JonZeolla on 8/28/2024 in #help
Using sh to generate a map?
Hi @JonZeolla, I suggest you do make a comment on https://github.com/go-task/task/issues/1585 with your proposal. There, it would be less likely to be forgotten, as Discord is more for questions than feature requests.
2 replies
TTask
Created by Bluestopher on 8/20/2024 in #help
Required input does not prevent dependencies from running and dependencies do not share variables
Hi @Bluestopher, 1. I would move DATE and GIT_HASH as global variables, and just reference them on the calls with DATE: '{{.DATE}}' 2. You might want to create an issue about this so we can think about changing this behavior in the future.
3 replies
TTask
Created by Aco-gt on 8/13/2024 in #help
How to use for loop with filenames containing spaces?
Hi @Aco-gt, Can you try using the shellQuote (aliases to q) template function? {{shellQuote .ITEM}} or {{q .ITEM}}
3 replies
TTask
Created by Alex Lewis on 8/2/2024 in #help
Should the 'generates' folders be automatically excluded from 'sources' evaluaton?
Does the date/time affect the output of the checksum checker?
What we do check is if there are any files from generates available. If not, we assume is wan't run and run again.
5 replies
TTask
Created by Leon on 7/14/2024 in #help
Static context issues
Hi @Leon, I'm actually not sure if we would want to add that behavior. That would improve the code complexity and add room for new bugs. Keep in mind that we need to take concurrency into account when implementing things, and sharing state between tasks might not play well with tasks running concurrently.
2 replies
TTask
Created by GokulnathP on 6/26/2024 in #help
is there a way to give required variables check in the root level similar to the task level?
@GokulnathP No, that is only available for tasks at the moment. Feel free to open an issue on GitHub with this feature request if you want.
3 replies
TTask
Created by Adlnc on 6/9/2024 in #help
Looking for advice - Rendering template files
Hi, To me, it looks as something that should be an external tool or script, and that you would use Task as just an entrypoint.
3 replies
TTask
Created by Leon on 6/5/2024 in #help
Referencing parent tasks
Hi @Leon, It is as simple as prepending : when calling the task:
cmds:
- task: :root-taskfile-name
cmds:
- task: :root-taskfile-name
5 replies
TTask
Created by José on 5/29/2024 in #help
commands composition?
Hi @José, Isn't this something that will work for you?
version: '3'

tasks:
internal_build:
cmds:
- env GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -ldflags "{{.LDFLAGS}}"

build-linux-amd64:
cmds:
- tasks: internal-build
vars:
GOOS: linux
GOARCH: amd64
LDFLAGS: foobarbaz

# tasks for other paltforms here...
version: '3'

tasks:
internal_build:
cmds:
- env GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -ldflags "{{.LDFLAGS}}"

build-linux-amd64:
cmds:
- tasks: internal-build
vars:
GOOS: linux
GOARCH: amd64
LDFLAGS: foobarbaz

# tasks for other paltforms here...
3 replies