mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-14 23:14:05 -08:00
30 lines
664 B
Go
30 lines
664 B
Go
|
package main
|
||
|
|
||
|
type crystal struct {
|
||
|
language *language
|
||
|
}
|
||
|
|
||
|
func (c *crystal) string() string {
|
||
|
return c.language.string()
|
||
|
}
|
||
|
|
||
|
func (c *crystal) init(props *properties, env environmentInfo) {
|
||
|
c.language = &language{
|
||
|
env: env,
|
||
|
props: props,
|
||
|
extensions: []string{"*.cr", "shard.yml"},
|
||
|
commands: []*cmd{
|
||
|
{
|
||
|
executable: "crystal",
|
||
|
args: []string{"--version"},
|
||
|
regex: `Crystal (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`,
|
||
|
},
|
||
|
},
|
||
|
versionURLTemplate: "[%s](https://github.com/crystal-lang/crystal/releases/tag/%s.%s.%s)",
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (c *crystal) enabled() bool {
|
||
|
return c.language.enabled()
|
||
|
}
|