Ai
1 Star 0 Fork 0

fanzuquan/oh-my-posh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
segment_node.go 654 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jan De Dobbeleer 提交于 2020-10-09 21:49 +08:00 . fix: improve star theme
package main
type node struct {
props *properties
env environmentInfo
nodeVersion string
}
const (
//DisplayVersion show the version number or not
DisplayVersion Property = "display_version"
)
func (n *node) string() string {
if n.props.getBool(DisplayVersion, true) {
return n.nodeVersion
}
return ""
}
func (n *node) init(props *properties, env environmentInfo) {
n.props = props
n.env = env
}
func (n *node) enabled() bool {
if !n.env.hasFiles("*.js") && !n.env.hasFiles("*.ts") {
return false
}
if !n.env.hasCommand("node") {
return false
}
n.nodeVersion = n.env.runCommand("node", "--version")
return true
}
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

搜索帮助