1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00

Support ~ in 'include' theme key for #308

This commit is contained in:
makeworld 2022-04-25 19:54:17 -04:00
parent bfb3893774
commit 3917402e2d

View File

@ -375,7 +375,12 @@ func Init() error {
// Include key comes first // Include key comes first
if incPath := configTheme.GetString("include"); incPath != "" { if incPath := configTheme.GetString("include"); incPath != "" {
incViper := viper.New() incViper := viper.New()
newIncPath, err := homedir.Expand(incPath)
if err == nil {
incViper.SetConfigFile(newIncPath)
} else {
incViper.SetConfigFile(incPath) incViper.SetConfigFile(incPath)
}
incViper.SetConfigType("toml") incViper.SetConfigType("toml")
err = incViper.ReadInConfig() err = incViper.ReadInConfig()
if err != nil { if err != nil {