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:
parent
0a9d76515e
commit
dbe8131b75
1 changed files with 1 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue