mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
b1c427abaa
commit
d45c51cccc
|
@ -11,6 +11,7 @@ type az struct {
|
||||||
env Environment
|
env Environment
|
||||||
|
|
||||||
AzureSubscription
|
AzureSubscription
|
||||||
|
Origin string
|
||||||
}
|
}
|
||||||
|
|
||||||
type AzureConfig struct {
|
type AzureConfig struct {
|
||||||
|
@ -123,6 +124,7 @@ func (a *az) getAzureProfile() bool {
|
||||||
for _, subscription := range config.Subscriptions {
|
for _, subscription := range config.Subscriptions {
|
||||||
if subscription.IsDefault {
|
if subscription.IsDefault {
|
||||||
a.AzureSubscription = *subscription
|
a.AzureSubscription = *subscription
|
||||||
|
a.Origin = "CLI"
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,5 +153,6 @@ func (a *az) getAzureRmContext() bool {
|
||||||
a.User = &AzureUser{
|
a.User = &AzureUser{
|
||||||
Name: defaultContext.Subscription.ExtendedProperties.Account,
|
Name: defaultContext.Subscription.ExtendedProperties.Account,
|
||||||
}
|
}
|
||||||
|
a.Origin = "PWSH"
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,20 @@ func TestAzSegment(t *testing.T) {
|
||||||
Template: "{{ .Burp }}",
|
Template: "{{ .Burp }}",
|
||||||
HasPowerShell: true,
|
HasPowerShell: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Case: "PWSH",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
ExpectedString: "PWSH",
|
||||||
|
Template: "{{ .Origin }}",
|
||||||
|
HasPowerShell: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Case: "CLI",
|
||||||
|
ExpectedEnabled: true,
|
||||||
|
ExpectedString: "CLI",
|
||||||
|
Template: "{{ .Origin }}",
|
||||||
|
HasCLI: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
|
|
Loading…
Reference in a new issue