mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-10 02:37:27 -08:00
f4027bd7b3
relates to #378
35 lines
793 B
Go
35 lines
793 B
Go
package main
|
|
|
|
type node struct {
|
|
language *language
|
|
}
|
|
|
|
func (n *node) string() string {
|
|
return n.language.string()
|
|
}
|
|
|
|
func (n *node) init(props *properties, env environmentInfo) {
|
|
n.language = &language{
|
|
env: env,
|
|
props: props,
|
|
extensions: []string{"*.js", "*.ts", "package.json", ".nvm"},
|
|
commands: []*cmd{
|
|
{
|
|
executable: "node",
|
|
args: []string{"--version"},
|
|
regex: `(?:v(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,
|
|
},
|
|
},
|
|
versionURLTemplate: "[%[1]s](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V%[2]s.md#%[1]s)",
|
|
matchesVersionFile: n.matchesVersionFile,
|
|
}
|
|
}
|
|
|
|
func (n *node) enabled() bool {
|
|
return n.language.enabled()
|
|
}
|
|
|
|
func (n *node) matchesVersionFile() bool {
|
|
return true
|
|
}
|