mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Fix the integration test
This commit is contained in:
@ -120,10 +120,12 @@ func (c *OSCommand) AppendLineToFile(filename, line string) error {
|
||||
return utils.WrapError(err)
|
||||
}
|
||||
|
||||
// read last char
|
||||
buf := make([]byte, 1)
|
||||
if _, err := f.ReadAt(buf, info.Size()-1); err != nil {
|
||||
return utils.WrapError(err)
|
||||
if info.Size() > 0 {
|
||||
// read last char
|
||||
if _, err := f.ReadAt(buf, info.Size()-1); err != nil {
|
||||
return utils.WrapError(err)
|
||||
}
|
||||
}
|
||||
|
||||
// if the last byte of the file is not a newline, add it
|
||||
|
Reference in New Issue
Block a user