garm/cmd/run-cli/config/home_nix.go

21 lines
308 B
Go
Raw Normal View History

2022-05-02 17:55:29 +00:00
//go:build !windows
// +build !windows
package config
import (
"fmt"
"os"
"path/filepath"
)
func getHomeDir() (string, error) {
home := os.Getenv("HOME")
if home == "" {
return "", fmt.Errorf("failed to get home folder")
}
return filepath.Join(home, ".local", "share", DefaultAppFolder), nil
}