func NewVersionRepo()

in astro/tvm/versionrepo.go [66:87]


func NewVersionRepo(repoPath string, arch string, platform string) (*VersionRepo, error) {
	if repoPath == "" {
		home, err := homedir.Dir()
		if err != nil {
			return nil, err
		}

		repoPath = filepath.Join(home, ".tvm")
	}

	// Create directory if it doesn't exist
	if err := os.Mkdir(repoPath, 0755); err != nil && !os.IsExist(err) {
		return nil, err
	}

	return &VersionRepo{
		locks:    &sync.Map{},
		repoPath: repoPath,
		arch:     arch,
		platform: platform,
	}, nil
}