oh-my-posh/src/segment_angular.go

30 lines
658 B
Go
Raw Normal View History

2021-10-13 00:05:29 -07:00
package main
type angular struct {
language *language
}
func (a *angular) string() string {
return a.language.string()
}
func (a *angular) init(props *properties, env environmentInfo) {
a.language = &language{
env: env,
props: props,
extensions: []string{"angular.json"},
commands: []*cmd{
{
executable: "ng",
args: []string{"--version"},
regex: `Angular CLI: (?:(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,
},
},
versionURLTemplate: "[%s](https://github.com/angular/angular/releases/tag/%s.%s.%s)",
}
}
func (a *angular) enabled() bool {
return a.language.enabled()
}