From c1d7aad1797039cd66e7ef8d3644b6981e3d63d2 Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Mon, 14 Jan 2019 19:39:37 -0800 Subject: [PATCH] Fix custom colorscheme not loading (Close #93) --- colorschemes/default.json | 2 +- main.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/colorschemes/default.json b/colorschemes/default.json index 99abfaa..12cab1b 100644 --- a/colorschemes/default.json +++ b/colorschemes/default.json @@ -1,5 +1,5 @@ // Example json file to put in `~/.config/gotop/{name}.json` and load with -// `gotop -c {name}`. MUST DELETE THESE COMMENTS in order to load. +// `gotop -c {name}`. MUST DELETE THESE COMMENTS AND RENAME FILE in order to load. { "Fg": 7, "Bg": -1, diff --git a/main.go b/main.go index 44a345f..1000396 100644 --- a/main.go +++ b/main.go @@ -125,10 +125,11 @@ func handleColorscheme(cs string) error { case "default-dark": colorscheme = colorschemes.DefaultDark default: - if colorscheme, err := getCustomColorscheme(cs); err != nil { - colorscheme = colorscheme + custom, err := getCustomColorscheme(cs) + if err != nil { return err } + colorscheme = custom } return nil }