homepath

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package homepath 复刻官方 util/home-paths 的用户数据根解析:按"显式配置 > OMNIX_HOME 环境变量 > ~/.omnix"的优先级确定唯一根,并支持 ~ 展开与符号化显示。

Index

Constants

View Source
const EnvName = "OMNIX_HOME"

EnvName 是覆盖默认 home 的环境变量名。

View Source
const HomeDirName = ".omnix"

HomeDirName 是默认 Harness home 目录名。

Variables

This section is empty.

Functions

func Display

func Display(resolvedHome string) string

Display 把解析后的 home 符号化:默认 home 显示为 ~/.omnix,自定义的显示为 $OMNIX_HOME。

func ExpandHome

func ExpandHome(path string) (string, error)

ExpandHome 展开开头的 ~、~/、~\\ 为操作系统 home;不支持的前缀原样返回。

func Resolve

func Resolve(configured string, env map[string]string) (string, error)

Resolve 按优先级解析 Harness home。configured 非空优先;否则用 env 中非空白 的 OMNIX_HOME;都没有则退回 ~/.omnix。

Types

This section is empty.

Jump to

Keyboard shortcuts

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