1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-13 23:45:45 +02:00

fix ignore feature

This commit is contained in:
Jesse Duffield
2018-08-19 20:41:04 +10:00
parent 51558f51ab
commit aa4d739577
3 changed files with 16 additions and 5 deletions

View File

@@ -174,3 +174,14 @@ func (c *OSCommand) Unquote(message string) string {
message = strings.Replace(message, `"`, "", -1)
return message
}
func (C *OSCommand) AppendLineToFile(filename, line string) error {
f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
if err != nil {
return err
}
defer f.Close()
_, err = f.WriteString("\n" + line)
return err
}