mirror of
https://github.com/go-task/task.git
synced 2025-07-15 01:35:00 +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:
@ -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)
|
||||
|
Reference in New Issue
Block a user