github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/internal/installation/paths_darwin.go (about)

     1  package installation
     2  
     3  import (
     4  	"path/filepath"
     5  
     6  	"github.com/ActiveState/cli/internal/errs"
     7  	"github.com/ActiveState/cli/internal/osutils/user"
     8  )
     9  
    10  func installPathForChannel(channel string) (string, error) {
    11  	home, err := user.HomeDir()
    12  	if err != nil {
    13  		return "", errs.Wrap(err, "Could not get home directory")
    14  	}
    15  	return filepath.Join(home, ".local", "ActiveState", "StateTool", channel), nil
    16  }
    17  
    18  func defaultSystemInstallPath() (string, error) {
    19  	home, err := user.HomeDir()
    20  	if err != nil {
    21  		return "", errs.Wrap(err, "Could not get home directory")
    22  	}
    23  
    24  	return filepath.Join(home, "Applications"), nil
    25  }