oh-my-posh/src/segment_az_functions.go

30 lines
675 B
Go
Raw Normal View History

2021-04-02 10:36:50 -07:00
package main
type azfunc struct {
2021-12-03 11:19:57 -08:00
language
2021-04-02 10:36:50 -07:00
}
func (az *azfunc) string() string {
segmentTemplate := az.language.props.getString(SegmentTemplate, "{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}")
return az.language.string(segmentTemplate, az)
2021-04-02 10:36:50 -07:00
}
2022-01-01 11:09:52 -08:00
func (az *azfunc) init(props Properties, env Environment) {
2021-12-03 11:19:57 -08:00
az.language = language{
2021-04-02 10:36:50 -07:00
env: env,
props: props,
extensions: []string{"host.json", "local.settings.json", "function.json"},
2021-04-02 10:36:50 -07:00
commands: []*cmd{
{
executable: "func",
args: []string{"--version"},
regex: `(?P<version>[0-9.]+)`,
2021-04-02 10:36:50 -07:00
},
},
}
}
func (az *azfunc) enabled() bool {
return az.language.enabled()
}