github.com/mutagen-io/mutagen@v0.18.0-rc1/pkg/configuration/global/paths.go (about)

     1  package global
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  	"path/filepath"
     7  
     8  	"github.com/mutagen-io/mutagen/pkg/filesystem"
     9  )
    10  
    11  // ConfigurationPath returns the path of the YAML-based global configuration
    12  // file. It does not verify that the file exists.
    13  func ConfigurationPath() (string, error) {
    14  	// Compute the path to the user's home directory.
    15  	homeDirectoryPath, err := os.UserHomeDir()
    16  	if err != nil {
    17  		return "", fmt.Errorf("unable to compute path to home directory: %w", err)
    18  	}
    19  
    20  	// Success.
    21  	return filepath.Join(homeDirectoryPath, filesystem.MutagenGlobalConfigurationName), nil
    22  }