feat: Add pulumi module (#3055)

This commit is contained in:
Ian Wahbe
2021-10-05 16:27:25 -07:00
committed by GitHub
parent 190743e4e0
commit dfb1208787
11 changed files with 489 additions and 7 deletions
+59
View File
@@ -221,6 +221,7 @@ $nodejs\
$ocaml\
$perl\
$php\
$pulumi\
$purescript\
$python\
$rlang\
@@ -2349,6 +2350,64 @@ By default the module will be shown if any of the following conditions are met:
format = "via [🔹 $version](147 bold) "
```
## Pulumi
The `pulumi` module shows the currently selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/) and version.
::: tip
By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms).
If you still want to enable it, [follow the example shown below](#with-pulumi-version).
:::
By default the module will be shown if any of the following conditions are met:
- The current directory contains either `Pulumi.yaml` or `Pulumi.yml`
- A parent directory contains either `Pulumi.yaml` or `Pulumi.yml`
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `" "` | A format string shown before the Pulumi stack. |
| `style` | `"bold 5"` | The style for the module. |
| `disabled` | `false` | Disables the `pulumi` module. |
### Variables
| Variable | Example | Description |
| -------- | ---------- | ------------------------------------ |
| version | `v0.12.24` | The version of `pulumi` |
| stack | `dev` | The current Pulumi stack |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string
### Example
#### With Pulumi Version
```toml
# ~/.config/starship.toml
[pulumi]
format = "[🛥 ($version )$stack]($style) "
```
#### Without Pulumi version
```toml
# ~/.config/starship.toml
[pulumi]
symbol = "🛥 "
format = "[$symbol$stack]($style) "
```
## PureScript
The `purescript` module shows the currently installed version of [PureScript](https://www.purescript.org/) version.
+9
View File
@@ -205,6 +205,9 @@ format = '\[[$symbol($version)]($style)\]'
[php]
format = '\[[$symbol($version)]($style)\]'
[pulumi]
format = '\[[$symbol$stack]($style)\]'
[purescript]
format = '\[[$symbol($version)]($style)\]'
@@ -354,6 +357,9 @@ symbol = "pl "
[php]
symbol = "php "
[pulumi]
symbol = "pulumi "
[purescript]
symbol = "purs "
@@ -439,6 +445,9 @@ format = 'via [$symbol]($style)'
[php]
format = 'via [$symbol]($style)'
[pulumi]
format = 'via [$symbol$stack]($style)'
[purescript]
format = 'via [$symbol]($style)'