mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-07 09:17:26 -08:00
35 lines
769 B
Go
35 lines
769 B
Go
package segments
|
|
|
|
import (
|
|
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
|
"github.com/jandedobbeleer/oh-my-posh/src/properties"
|
|
)
|
|
|
|
type Deno struct {
|
|
language
|
|
}
|
|
|
|
func (d *Deno) Template() string {
|
|
return languageTemplate
|
|
}
|
|
|
|
func (d *Deno) Init(props properties.Properties, env platform.Environment) {
|
|
d.language = language{
|
|
env: env,
|
|
props: props,
|
|
extensions: []string{"*.js", "*.ts", "deno.json"},
|
|
commands: []*cmd{
|
|
{
|
|
executable: "deno",
|
|
args: []string{"--version"},
|
|
regex: `(?:(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,
|
|
},
|
|
},
|
|
versionURLTemplate: "https://github.com/denoland/deno/releases/tag/v{{.Full}}",
|
|
}
|
|
}
|
|
|
|
func (d *Deno) Enabled() bool {
|
|
return d.language.Enabled()
|
|
}
|