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:
parent
0a9d76515e
commit
dbe8131b75
@ -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 New Issue
Block a user