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

Close Taskfile after reading it (#964)

This should fix issues preventing modifications to the Taskfile while tasks are still running, like switching git branches for example.

See #963.
This commit is contained in:
Henrique Corrêa 2022-12-22 21:23:17 -03:00 committed by GitHub
parent 0a9d76515e
commit dbe8131b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,6 +197,7 @@ func readTaskfile(file string) (*taskfile.Taskfile, error) {
if err != nil {
return nil, err
}
defer f.Close()
var t taskfile.Taskfile
if err := yaml.NewDecoder(f).Decode(&t); err != nil {
return nil, fmt.Errorf("task: Failed to parse %s:\n%w", filepathext.TryAbsToRel(file), err)