mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-03 15:27:26 -08:00
35 lines
737 B
Go
35 lines
737 B
Go
package segments
|
|
|
|
import (
|
|
"oh-my-posh/environment"
|
|
"oh-my-posh/properties"
|
|
)
|
|
|
|
type Kotlin struct {
|
|
language
|
|
}
|
|
|
|
func (k *Kotlin) Template() string {
|
|
return languageTemplate
|
|
}
|
|
|
|
func (k *Kotlin) Init(props properties.Properties, env environment.Environment) {
|
|
k.language = language{
|
|
env: env,
|
|
props: props,
|
|
extensions: []string{"*.kt", "*.kts", "*.ktm"},
|
|
commands: []*cmd{
|
|
{
|
|
executable: "kotlin",
|
|
args: []string{"-version"},
|
|
regex: `Kotlin version (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`,
|
|
},
|
|
},
|
|
versionURLTemplate: "https://github.com/JetBrains/kotlin/releases/tag/v{{ .Full }}",
|
|
}
|
|
}
|
|
|
|
func (k *Kotlin) Enabled() bool {
|
|
return k.language.Enabled()
|
|
}
|