1 Star 0 Fork 0

fanzuquan/oh-my-posh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
segment_envar.go 459 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jan De Dobbeleer 提交于 2020-10-10 01:22 +08:00 . feat: env var segment
package main
type envvar struct {
props *properties
env environmentInfo
content string
}
const (
//VarName name of the variable
VarName Property = "var_name"
)
func (e *envvar) enabled() bool {
name := e.props.getString(VarName, "")
e.content = e.env.getenv(name)
return e.content != ""
}
func (e *envvar) string() string {
return e.content
}
func (e *envvar) init(props *properties, env environmentInfo) {
e.props = props
e.env = env
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fanzuquan/oh-my-posh.git
git@gitee.com:fanzuquan/oh-my-posh.git
fanzuquan
oh-my-posh
oh-my-posh
v3.15.0

搜索帮助