Resolve issue with debian package building, use $HOME/.config/pastee as config path
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
@ -48,9 +49,10 @@ func initConfig() {
|
||||
home, err := homedir.Dir()
|
||||
cobra.CheckErr(err)
|
||||
|
||||
viper.SetConfigName(".pastee")
|
||||
viper.SetConfigName("pastee")
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(home)
|
||||
viper.AddConfigPath(path.Join(home, ".config", "pastee"))
|
||||
viper.AddConfigPath("/etc")
|
||||
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||
|
Reference in New Issue
Block a user