Skip to content

Commit 5b2d40f

Browse files
committed
theme/powerline: SC2154, SC2248
1 parent eb564d5 commit 5b2d40f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

themes/powerline/powerline.base.bash

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# shellcheck shell=bash
22
# shellcheck disable=SC2034 # Expected behavior for themes.
3-
# shellcheck disable=SC2154 #TODO: fix these all.
43

54
# Define this here so it can be used by all of the Powerline themes
65
THEME_CHECK_SUDO=${THEME_CHECK_SUDO:=true}
@@ -137,7 +136,7 @@ function __powerline_scm_prompt() {
137136
elif [[ "${SCM_SVN_CHAR}" == "${SCM_CHAR}" ]]; then
138137
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
139138
fi
140-
echo "$(eval "echo ${scm_prompt}")${scm}|${color}"
139+
echo "${scm_prompt?}${scm?}|${color}"
141140
fi
142141
}
143142

@@ -245,12 +244,12 @@ function __powerline_left_segment() {
245244
# Since the previous segment wasn't the last segment, add padding, if needed
246245
#
247246
if [[ "${POWERLINE_COMPACT_BEFORE_SEPARATOR}" -eq 0 ]]; then
248-
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal}"
247+
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal?}"
249248
fi
250249
if [[ "${LAST_SEGMENT_COLOR}" -eq "${params[1]}" ]]; then
251-
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}")${POWERLINE_LEFT_SEPARATOR_SOFT}${normal}"
250+
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}")${POWERLINE_LEFT_SEPARATOR_SOFT}${normal?}"
252251
else
253-
LEFT_PROMPT+="$(set_color "${LAST_SEGMENT_COLOR}" "${params[1]}")${POWERLINE_LEFT_SEPARATOR}${normal}"
252+
LEFT_PROMPT+="$(set_color "${LAST_SEGMENT_COLOR}" "${params[1]}")${POWERLINE_LEFT_SEPARATOR}${normal?}"
254253
fi
255254
fi
256255

@@ -260,7 +259,7 @@ function __powerline_left_segment() {
260259
}
261260

262261
function __powerline_left_last_segment_padding() {
263-
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal}"
262+
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}") ${normal?}"
264263
}
265264

266265
function __powerline_last_status_prompt() {
@@ -285,9 +284,9 @@ function __powerline_prompt_command() {
285284
[[ -n "${info}" ]] && __powerline_left_segment "${info}"
286285
done
287286

288-
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment "$(__powerline_last_status_prompt ${last_status})"
287+
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment "$(__powerline_last_status_prompt "${last_status}")"
289288

290-
if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT}" -eq 0 ]]; then
289+
if [[ -n "${LEFT_PROMPT}" ]] && [[ "${POWERLINE_COMPACT_AFTER_LAST_SEGMENT:-}" -eq 0 ]]; then
291290
__powerline_left_last_segment_padding
292291
fi
293292

@@ -296,11 +295,11 @@ function __powerline_prompt_command() {
296295
prompt_color="$(set_color "${LAST_SEGMENT_COLOR}" -)"
297296
if [[ -n "${LEFT_PROMPT}" ]] && [[ -n "${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR}" ]]; then
298297
LEFT_PROMPT+="$(set_color - "${LAST_SEGMENT_COLOR}")${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR}"
299-
prompt_color="${normal}"
298+
prompt_color="${normal?}"
300299
fi
301-
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="${prompt_color}${separator_char}${normal}"
300+
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="${prompt_color}${separator_char}${normal?}"
302301

303-
if [[ "${POWERLINE_COMPACT_PROMPT}" -eq 0 ]]; then
302+
if [[ "${POWERLINE_COMPACT_PROMPT:-}" -eq 0 ]]; then
304303
LEFT_PROMPT+=" "
305304
fi
306305

0 commit comments

Comments
 (0)