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