mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
create log if debugging and the file doesn't already exist
This commit is contained in:
parent
4832d365f1
commit
ace8544512
1 changed files with 4 additions and 1 deletions
5
main.go
5
main.go
|
@ -62,7 +62,10 @@ func localLog(colour color.Attribute, path string, objects ...interface{}) {
|
|||
if !*debuggingFlag {
|
||||
return
|
||||
}
|
||||
f, _ := os.OpenFile(projectPath(path), os.O_APPEND|os.O_WRONLY, 0644)
|
||||
f, err := os.OpenFile(projectPath(path), os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
defer f.Close()
|
||||
for _, object := range objects {
|
||||
colorFunction := color.New(colour).SprintFunc()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue