mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat(project): add support for mojo
This commit is contained in:
parent
2791f78e46
commit
d64de61436
|
@ -76,6 +76,11 @@ func (n *Project) Enabled() bool {
|
||||||
Files: []string{"pyproject.toml"},
|
Files: []string{"pyproject.toml"},
|
||||||
Fetcher: n.getPythonPackage,
|
Fetcher: n.getPythonPackage,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "mojo",
|
||||||
|
Files: []string{"mojoproject.toml"},
|
||||||
|
Fetcher: n.getPythonPackage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "php",
|
Name: "php",
|
||||||
Files: []string{"composer.json"},
|
Files: []string{"composer.json"},
|
||||||
|
|
|
@ -138,6 +138,22 @@ func TestPackage(t *testing.T) {
|
||||||
File: "pyproject.toml",
|
File: "pyproject.toml",
|
||||||
PackageContents: "[project]\nname=\"test\"\nversion=\"3.2.1\"\n",
|
PackageContents: "[project]\nname=\"test\"\nversion=\"3.2.1\"\n",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Case: "1.0.0 mojo",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
ExpectedString: "\uf487 1.0.0 test",
|
||||||
|
Name: "mojo",
|
||||||
|
File: "mojoproject.toml",
|
||||||
|
PackageContents: "[project]\nname=\"test\"\nversion=\"1.0.0\"\n",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Case: "3.2.1 mojo",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
ExpectedString: "\uf487 3.2.1 test",
|
||||||
|
Name: "mojo",
|
||||||
|
File: "mojoproject.toml",
|
||||||
|
PackageContents: "[project]\nname=\"test\"\nversion=\"3.2.1\"\n",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Case: "No version present node.js",
|
Case: "No version present node.js",
|
||||||
ExpectedEnabled: true,
|
ExpectedEnabled: true,
|
||||||
|
@ -178,6 +194,14 @@ func TestPackage(t *testing.T) {
|
||||||
File: "pyproject.toml",
|
File: "pyproject.toml",
|
||||||
PackageContents: "[project]\nname=\"test\"\n",
|
PackageContents: "[project]\nname=\"test\"\n",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Case: "No version present mojo",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
ExpectedString: "test",
|
||||||
|
Name: "mojo",
|
||||||
|
File: "mojoproject.toml",
|
||||||
|
PackageContents: "[project]\nname=\"test\"\n",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Case: "No name present node.js",
|
Case: "No name present node.js",
|
||||||
ExpectedEnabled: true,
|
ExpectedEnabled: true,
|
||||||
|
@ -218,6 +242,14 @@ func TestPackage(t *testing.T) {
|
||||||
File: "pyproject.toml",
|
File: "pyproject.toml",
|
||||||
PackageContents: "[project]\nversion=\"1.0.0\"\n",
|
PackageContents: "[project]\nversion=\"1.0.0\"\n",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Case: "No name present mojo",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
ExpectedString: "\uf487 1.0.0",
|
||||||
|
Name: "mojo",
|
||||||
|
File: "mojoproject.toml",
|
||||||
|
PackageContents: "[project]\nversion=\"1.0.0\"\n",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Case: "Empty project package node.js",
|
Case: "Empty project package node.js",
|
||||||
ExpectedEnabled: true,
|
ExpectedEnabled: true,
|
||||||
|
@ -246,6 +278,13 @@ func TestPackage(t *testing.T) {
|
||||||
File: "pyproject.toml",
|
File: "pyproject.toml",
|
||||||
PackageContents: "",
|
PackageContents: "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Case: "Empty project package mojo",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
Name: "mojo",
|
||||||
|
File: "mojoproject.toml",
|
||||||
|
PackageContents: "",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Case: "Invalid json",
|
Case: "Invalid json",
|
||||||
ExpectedString: "invalid character '}' looking for beginning of value",
|
ExpectedString: "invalid character '}' looking for beginning of value",
|
||||||
|
|
|
@ -13,6 +13,7 @@ Supports:
|
||||||
- Node.js project (`package.json`)
|
- Node.js project (`package.json`)
|
||||||
- Cargo project (`Cargo.toml`)
|
- Cargo project (`Cargo.toml`)
|
||||||
- Python project (`pyproject.toml`, supports metadata defined according to [PEP 621][pep621-standard] or [Poetry][poetry-standard])
|
- Python project (`pyproject.toml`, supports metadata defined according to [PEP 621][pep621-standard] or [Poetry][poetry-standard])
|
||||||
|
- Mojo project (`mojoproject.toml`)
|
||||||
- PHP project (`composer.json`)
|
- PHP project (`composer.json`)
|
||||||
- Dart project (`pubspec.yaml`)
|
- Dart project (`pubspec.yaml`)
|
||||||
- Any nuspec based project (`*.nuspec`, first file match info is displayed)
|
- Any nuspec based project (`*.nuspec`, first file match info is displayed)
|
||||||
|
@ -38,7 +39,7 @@ import Config from "@site/src/components/Config.js";
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| ---------------- | :-------: | :-----: | ----------------------- |
|
| ---------------- | :-------: | :-----: | ----------------------- |
|
||||||
| `always_enabled` | `boolean` | `false` | always show the segment |
|
| `always_enabled` | `boolean` | `false` | always show the segment |
|
||||||
|
|
||||||
|
@ -54,13 +55,13 @@ import Config from "@site/src/components/Config.js";
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `.Type` | `string` | The type of project:<ul><li>`node`</li><li>`cargo`</li><li>`python`</li><li>`php`</li><li>`dart`</li><li>`nuspec`</li><li>`dotnet`</li><li>`julia`</li><li>`powershell`</li></ul> |
|
| `.Type` | `string` | The type of project:<ul><li>`node`</li><li>`cargo`</li><li>`python`</li><li>`mojo`</li><li>`php`</li><li>`dart`</li><li>`nuspec`</li><li>`dotnet`</li><li>`julia`</li><li>`powershell`</li></ul> |
|
||||||
| `.Version` | `string` | The version of your project |
|
| `.Version` | `string` | The version of your project |
|
||||||
| `.Target` | `string` | The target framework/language version of your project |
|
| `.Target` | `string` | The target framework/language version of your project |
|
||||||
| `.Name` | `string` | The name of your project |
|
| `.Name` | `string` | The name of your project |
|
||||||
| `.Error` | `string` | The error context when we can't fetch the project info |
|
| `.Error` | `string` | The error context when we can't fetch the project info |
|
||||||
|
|
||||||
[templates]: /docs/configuration/templates
|
[templates]: /docs/configuration/templates
|
||||||
[pep621-standard]: https://peps.python.org/pep-0621/
|
[pep621-standard]: https://peps.python.org/pep-0621/
|
||||||
|
|
Loading…
Reference in a new issue