mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-29 12:01:07 -08:00
refactor: remove MissingCommandText
This commit is contained in:
parent
a3a58feb0e
commit
ae10564f2b
|
@ -81,10 +81,8 @@ const (
|
|||
DisplayModeEnvironment string = "environment"
|
||||
// DisplayModeContext displays the segment when the environment or files is active
|
||||
DisplayModeContext string = "context"
|
||||
// MissingCommandTextProperty sets the text to display when the command is not present in the system
|
||||
MissingCommandTextProperty Property = "missing_command_text"
|
||||
// MissingCommandText displays empty string by default
|
||||
MissingCommandText string = ""
|
||||
// MissingCommandText sets the text to display when the command is not present in the system
|
||||
MissingCommandText Property = "missing_command_text"
|
||||
)
|
||||
|
||||
func (l *language) string() string {
|
||||
|
@ -152,7 +150,7 @@ func (l *language) setVersion() error {
|
|||
l.activeCommand = command
|
||||
return nil
|
||||
}
|
||||
return errors.New(l.props.getString(MissingCommandTextProperty, MissingCommandText))
|
||||
return errors.New(l.props.getString(MissingCommandText, ""))
|
||||
}
|
||||
|
||||
func (l *language) loadLanguageContext() {
|
||||
|
|
|
@ -52,7 +52,7 @@ func bootStrapLanguageTest(args *languageArgs) *language {
|
|||
},
|
||||
}
|
||||
if args.missingCommandText != "" {
|
||||
props.values[MissingCommandTextProperty] = args.missingCommandText
|
||||
props.values[MissingCommandText] = args.missingCommandText
|
||||
}
|
||||
l := &language{
|
||||
props: props,
|
||||
|
@ -78,7 +78,7 @@ func TestLanguageFilesFoundButNoCommandAndVersionAndDisplayVersion(t *testing.T)
|
|||
}
|
||||
lang := bootStrapLanguageTest(args)
|
||||
assert.True(t, lang.enabled())
|
||||
assert.Equal(t, MissingCommandText, lang.string(), "unicorn is not available")
|
||||
assert.Equal(t, "", lang.string(), "unicorn is not available")
|
||||
}
|
||||
|
||||
func TestLanguageFilesFoundButNoCommandAndVersionAndDontDisplayVersion(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue