dotfile

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dotfile provides operations on the application dot file.

The dot file stores a build identifier of the form "version/edition" (e.g. "v0.160.0/extended"). Files written by older versions of hvm contain only a version string; Read migrates these automatically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles operations on the dot file.

func NewManager

func NewManager(filePath, fileName, appName, defaultEdition string) *Manager

NewManager creates a new dotfile manager. defaultEdition is used when migrating dot files written by older versions of hvm that contain only a version string.

func (*Manager) Read

func (m *Manager) Read() (string, error)

Read reads the build identifier ("version/edition") from the dot file in the current directory, or returns an empty string if the file does not exist.

If the file contains only a version (written by an older version of hvm), Read migrates it to the version/edition format, rewrites the file, and prints a warning to stderr.

func (*Manager) Write

func (m *Manager) Write(version string) error

Write writes the version to the dot file for the current directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL