mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-01 13:17:53 +02:00
Improve error reporting on config migration
This commit is contained in:
parent
2bed09ef67
commit
afc3061c51
@ -245,9 +245,11 @@ func migrateUserConfig(path string, content []byte) ([]byte, error) {
|
||||
|
||||
// Write config back if changed
|
||||
if string(changedContent) != string(content) {
|
||||
fmt.Println("Provided user config is deprecated but auto-fixable. Attempting to write fixed version back to file...")
|
||||
if err := os.WriteFile(path, changedContent, 0o644); err != nil {
|
||||
return nil, fmt.Errorf("Couldn't write migrated config back to `%s`: %s", path, err)
|
||||
return nil, fmt.Errorf("While attempting to write back fixed user config to %s, an error occurred: %s", path, err)
|
||||
}
|
||||
fmt.Printf("Success. New config written to %s\n", path)
|
||||
return changedContent, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user