2022-01-26 06:54:36 -08:00
|
|
|
package segments
|
2021-04-02 10:36:50 -07:00
|
|
|
|
2022-01-26 04:53:35 -08:00
|
|
|
import (
|
|
|
|
"oh-my-posh/environment"
|
|
|
|
"oh-my-posh/properties"
|
|
|
|
)
|
2022-01-26 01:23:18 -08:00
|
|
|
|
2022-01-26 05:10:18 -08:00
|
|
|
type AzFunc struct {
|
2021-12-03 11:19:57 -08:00
|
|
|
language
|
2021-04-02 10:36:50 -07:00
|
|
|
}
|
|
|
|
|
2022-01-26 05:26:56 -08:00
|
|
|
func (az *AzFunc) Template() string {
|
2022-01-23 12:37:51 -08:00
|
|
|
return languageTemplate
|
2021-04-02 10:36:50 -07:00
|
|
|
}
|
|
|
|
|
2022-01-26 05:26:56 -08:00
|
|
|
func (az *AzFunc) Init(props properties.Properties, env environment.Environment) {
|
2021-12-03 11:19:57 -08:00
|
|
|
az.language = language{
|
2021-04-02 10:36:50 -07:00
|
|
|
env: env,
|
|
|
|
props: props,
|
2021-10-24 09:42:01 -07:00
|
|
|
extensions: []string{"host.json", "local.settings.json", "function.json"},
|
2021-04-02 10:36:50 -07:00
|
|
|
commands: []*cmd{
|
|
|
|
{
|
|
|
|
executable: "func",
|
|
|
|
args: []string{"--version"},
|
2021-10-26 10:50:30 -07:00
|
|
|
regex: `(?P<version>[0-9.]+)`,
|
2021-04-02 10:36:50 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-26 05:26:56 -08:00
|
|
|
func (az *AzFunc) Enabled() bool {
|
|
|
|
return az.language.Enabled()
|
2021-04-02 10:36:50 -07:00
|
|
|
}
|