summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2019-01-14 19:39:37 -0800
committerCaleb Bassi <calebjbassi@gmail.com>2019-01-14 19:39:37 -0800
commitc1d7aad1797039cd66e7ef8d3644b6981e3d63d2 (patch)
tree4d0f2fc886e598612972e6b9eb6761f6c0d5c8df
parent13b6294176f4ca9ecbe71bb54ef525c7c8611325 (diff)
Fix custom colorscheme not loading (Close #93)
-rw-r--r--colorschemes/default.json2
-rw-r--r--main.go5
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
}