oh-my-posh/src/segments/deno.go

35 lines
769 B
Go
Raw Normal View History

2022-09-18 00:01:52 -07:00
package segments
import (
"github.com/jandedobbeleer/oh-my-posh/src/platform"
"github.com/jandedobbeleer/oh-my-posh/src/properties"
2022-09-18 00:01:52 -07:00
)
type Deno struct {
language
}
func (d *Deno) Template() string {
return languageTemplate
}
2022-11-09 11:27:54 -08:00
func (d *Deno) Init(props properties.Properties, env platform.Environment) {
2022-09-18 00:01:52 -07:00
d.language = language{
env: env,
props: props,
extensions: []string{"*.js", "*.ts", "deno.json"},
2022-09-18 00:01:52 -07:00
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()
}