From 3917402e2d44b6a302bf4a4d39570896a989d29c Mon Sep 17 00:00:00 2001 From: makeworld Date: Mon, 25 Apr 2022 19:54:17 -0400 Subject: [PATCH] Support ~ in 'include' theme key for #308 --- config/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 9c3acb6..c52c387 100644 --- a/config/config.go +++ b/config/config.go @@ -375,7 +375,12 @@ func Init() error { // Include key comes first if incPath := configTheme.GetString("include"); incPath != "" { incViper := viper.New() - incViper.SetConfigFile(incPath) + newIncPath, err := homedir.Expand(incPath) + if err == nil { + incViper.SetConfigFile(newIncPath) + } else { + incViper.SetConfigFile(incPath) + } incViper.SetConfigType("toml") err = incViper.ReadInConfig() if err != nil {