refactor: remove error_icon property

This commit is contained in:
Jan De Dobbeleer 2020-09-30 11:25:54 +02:00 committed by Jan De Dobbeleer
parent 71c610aaa8
commit 592f4147a2
17 changed files with 17 additions and 24 deletions

View file

@ -71,7 +71,7 @@
"foreground": "#ffffff",
"background": "#ff8080",
"properties": {
"error_icon": ""
"prefix": ""
}
}
]

View file

@ -41,7 +41,7 @@
"style": "plain",
"foreground": "#C94A16",
"properties": {
"error_icon": "x"
"prefix": "x"
}
}
]

View file

@ -46,8 +46,7 @@
"style": "plain",
"foreground": "#ffffff",
"properties": {
"error_icon": "x",
"prefix": "<#CB4B16>[</>",
"prefix": "<#CB4B16>[x</>",
"postfix": "<#CB4B16>]</>"
}
}

View file

@ -52,7 +52,7 @@
"style": "plain",
"foreground": "#C94A16",
"properties": {
"error_icon": "x"
"prefix": "x"
}
},
{

View file

@ -9,7 +9,7 @@
"style": "plain",
"foreground": "#ffffff",
"properties": {
"error_icon": " ",
"prefix": " ",
"postfix": ""
}
},

View file

@ -89,8 +89,7 @@
"style": "plain",
"foreground": "#CB4B16",
"properties": {
"prefix": "",
"error_icon": ""
"prefix": ""
}
},
{

View file

@ -91,12 +91,11 @@
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"error_icon": "",
"display_exit_code": false,
"always_enabled": true,
"error_color": "#e91e63",
"color_background": true,
"prefix": "<#193549> </>"
"prefix": "<#193549></>"
}
}
]

View file

@ -36,7 +36,7 @@
"style": "plain",
"foreground": "#DCB977",
"properties": {
"error_icon": "✗",
"prefix": "✗",
"display_exit_code": false
}
},

View file

@ -71,7 +71,7 @@
"foreground": "#ffffff",
"background": "#ff8080",
"properties": {
"error_icon": ""
"prefix": ""
}
}
]

View file

@ -37,7 +37,7 @@
"style": "plain",
"foreground": "#DCB977",
"properties": {
"error_icon": "✗",
"prefix": "✗",
"display_exit_code": false
}
}

View file

@ -92,8 +92,7 @@
"style": "plain",
"foreground": "#D4E157",
"properties": {
"prefix": "",
"error_icon": "",
"prefix": "",
"always_enabled": true,
"error_color": "#FF5252",
"display_exit_code": false

View file

@ -64,7 +64,7 @@
"foreground": "#ffffff",
"background": "#ff8080",
"properties": {
"error_icon": ""
"prefix": ""
}
}
]

View file

@ -37,7 +37,7 @@
"style": "plain",
"foreground": "#DCB977",
"properties": {
"error_icon": "✗",
"prefix": "✗",
"display_exit_code": false
}
}

View file

@ -9,7 +9,7 @@
"style": "plain",
"foreground": "#CB4B16",
"properties": {
"error_icon": ""
"prefix": ""
}
},
{

View file

@ -47,7 +47,7 @@
"style": "plain",
"foreground": "#C94A16",
"properties": {
"error_icon": "x"
"prefix": "x"
}
}
]

View file

@ -49,7 +49,7 @@
"style": "plain",
"foreground": "#DCB977",
"properties": {
"error_icon": "✗",
"prefix": "✗",
"display_exit_code": false,
"postfix": ""
}

View file

@ -8,8 +8,6 @@ type exit struct {
}
const (
//ErrorIcon represents icon to display in case of error
ErrorIcon Property = "error_icon"
//DisplayExitCode shows or hides the error code
DisplayExitCode Property = "display_exit_code"
//AlwaysEnabled decides whether or not to always display the exitcode info
@ -35,7 +33,6 @@ func (e *exit) init(props *properties, env environmentInfo) {
}
func (e *exit) getFormattedText() string {
errorIcon := e.props.getString(ErrorIcon, "X")
exitCode := e.getMeaningFromExitCode()
colorBackground := e.props.getBool(ColorBackground, false)
if e.env.lastErrorCode() != 0 && !colorBackground {
@ -44,7 +41,7 @@ func (e *exit) getFormattedText() string {
if e.env.lastErrorCode() != 0 && colorBackground {
e.props.background = e.props.getColor(ErrorColor, e.props.background)
}
return fmt.Sprintf("%s%s", errorIcon, exitCode)
return exitCode
}
func (e *exit) getMeaningFromExitCode() string {