forked from JanDeDobbeleer/oh-my-posh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0ae4a7
commit 8f473df
Showing
5 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
id: crystal | ||
title: Crystal | ||
sidebar_label: Crystal | ||
--- | ||
|
||
## What | ||
|
||
Display the currently active crystal version. | ||
|
||
## Sample Configuration | ||
|
||
```json | ||
{ | ||
"type": "crystal", | ||
"style": "powerline", | ||
"powerline_symbol": "\uE0B0", | ||
"foreground": "#ffffff", | ||
"background": "#4063D8", | ||
"properties": { | ||
"prefix": " \uE370 " | ||
} | ||
} | ||
``` | ||
|
||
## Properties | ||
|
||
- display_version: `boolean` - display the julia version - defaults to `true` | ||
- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` | ||
- missing_command_text: `string` - text to display when the command is missing - defaults to empty | ||
- display_mode: `string` - determines when the segment is displayed | ||
- `always`: the segment is always displayed | ||
- `files`: the segment is only displayed when `*.cr` or `shard.yml` files are present (default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters