2021-05-14 12:26:26 -07:00
|
|
|
package main
|
|
|
|
|
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 Dart struct {
|
2021-12-03 11:19:57 -08:00
|
|
|
language
|
2021-05-14 12:26:26 -07:00
|
|
|
}
|
|
|
|
|
2022-01-26 05:26:56 -08:00
|
|
|
func (d *Dart) Template() string {
|
2022-01-23 12:37:51 -08:00
|
|
|
return languageTemplate
|
2021-05-14 12:26:26 -07:00
|
|
|
}
|
|
|
|
|
2022-01-26 05:26:56 -08:00
|
|
|
func (d *Dart) Init(props properties.Properties, env environment.Environment) {
|
2021-12-03 11:19:57 -08:00
|
|
|
d.language = language{
|
2021-05-14 12:26:26 -07:00
|
|
|
env: env,
|
|
|
|
props: props,
|
|
|
|
extensions: []string{"*.dart", "pubspec.yaml", "pubspec.yml", "pubspec.lock", ".dart_tool"},
|
|
|
|
commands: []*cmd{
|
|
|
|
{
|
|
|
|
executable: "dart",
|
|
|
|
args: []string{"--version"},
|
|
|
|
regex: `Dart SDK version: (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`,
|
|
|
|
},
|
|
|
|
},
|
2022-01-23 09:48:55 -08:00
|
|
|
versionURLTemplate: "https://dart.dev/guides/language/evolution#dart-{{ .Major }}{{ .Minor }}",
|
2021-05-14 12:26:26 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-26 05:26:56 -08:00
|
|
|
func (d *Dart) Enabled() bool {
|
|
|
|
return d.language.Enabled()
|
2021-05-14 12:26:26 -07:00
|
|
|
}
|