mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +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
|
// Write config back if changed
|
||||||
if string(changedContent) != string(content) {
|
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 {
|
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
|
return changedContent, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user