mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix(install): release file lock before return
This commit is contained in:
parent
b8180b197c
commit
d9c2fbb784
|
@ -32,16 +32,14 @@ func install(tag string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
defer fp.Close()
|
||||
|
||||
_, err = io.Copy(fp, bytes.NewReader(data))
|
||||
// windows will have a lock when we do not close the file
|
||||
fp.Close()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// windows will have a lock when we do not close the file
|
||||
fp.Close()
|
||||
|
||||
oldPath := filepath.Join(targetDir, fmt.Sprintf(".%s.old", fileName))
|
||||
|
||||
_ = os.Remove(oldPath)
|
||||
|
|
Loading…
Reference in a new issue