Skip to content
Snippets Groups Projects
Commit c18bb20d authored by roshless's avatar roshless
Browse files

config: default to .config in home for real

parent b0f539cd
Branches master
Tags 4
No related merge requests found
Pipeline #867 passed
......@@ -3,6 +3,8 @@ package config
import (
"log"
"os"
"os/user"
"path/filepath"
"gopkg.in/yaml.v3"
)
......@@ -41,3 +43,12 @@ func NewConfig(path string) *Config {
func GetConfig() *Config {
return cfg
}
func GetDefaultConfigPath() string {
usr, err := user.Current()
if err != nil {
return "couldnt get user home directory"
}
dir := usr.HomeDir
return filepath.Join(dir, ".config/fup/config.yml")
}
......@@ -14,7 +14,7 @@ import (
var (
helpFlag bool
configPath = "~/.config/fup/config.yml"
configPath = config.GetDefaultConfigPath()
filePath string
fileName = uuid.NewString()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment