mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
Let schema/config.json end with a line feed
Some editors add one automatically when saving the file, which causes confusion and ugly diffs containing `\ No newline at end of file`.
This commit is contained in:
@ -20,6 +20,7 @@ func GetSchemaDir() string {
|
|||||||
func GenerateSchema() {
|
func GenerateSchema() {
|
||||||
schema := customReflect(&config.UserConfig{})
|
schema := customReflect(&config.UserConfig{})
|
||||||
obj, _ := json.MarshalIndent(schema, "", " ")
|
obj, _ := json.MarshalIndent(schema, "", " ")
|
||||||
|
obj = append(obj, '\n')
|
||||||
|
|
||||||
if err := os.WriteFile(GetSchemaDir()+"/config.json", obj, 0o644); err != nil {
|
if err := os.WriteFile(GetSchemaDir()+"/config.json", obj, 0o644); err != nil {
|
||||||
fmt.Println("Error writing to file:", err)
|
fmt.Println("Error writing to file:", err)
|
||||||
|
Reference in New Issue
Block a user