2022-09-18 00:01:52 -07:00
|
|
|
package segments
|
|
|
|
|
|
|
|
import (
|
2023-01-05 12:57:38 -08:00
|
|
|
"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,
|
2022-09-23 12:10:17 -07:00
|
|
|
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()
|
|
|
|
}
|