Skip to content

Commit ce68ba2

Browse files
committed
github-cicd: shellcheck: fix a few more SC1087, SC2145, SC2148
1 parent 9d9257b commit ce68ba2

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- Mode: shell-script -*-
2+
# shellcheck shell=bash
3+
14
if [ -e /etc/turnkey_version ] ; then
25
PROMPT_COMMAND=handleprompt
36
fi

files/tree/etc/bash.bashrc.d/finalise_prompt.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- Mode: shell-script -*-
2+
# shellcheck shell=bash
3+
14
# unconditionally set PROMPT_COMMAND as an inexpensive way of
25
# intercepting the first time a prompt is returned once a shell is
36
# opened. Sourcing this file more than once won't result in that

files/tree/etc/bash.bashrc.d/helpers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ log_to_file() {
6868
# debugging trace functions
6969
calling() {
7070
if [ -n "$BASH_DEBUG" ] ; then
71-
echo "Calling: $@"
71+
echo "Calling:" "$@"
7272
# bt
7373
print_callers
7474
fi 1>&2
7575
}
7676

7777
called() {
7878
if [ -n "$BASH_DEBUG" ] ; then
79-
echo "Returning from: $@"
79+
echo "Returning from:" "$@"
8080
# bt
8181
print_callers
8282
fi 1>&2

files/tree/etc/bash.bashrc.d/prompt.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ else
211211
if [ "$REALHOST" != "$LONGHOST" ] ; then
212212
me="${USER}"@"${REALHOST}"
213213
fi
214-
local bold="\\[$ESC[7m\\]"
215-
local norm="\\[$ESC[m\\]"
214+
local bold="\\[${ESC}[7m\\]"
215+
local norm="\\[${ESC}[m\\]"
216216
local shell=
217217
[ -z "$SSH_CONNECTION" ] && background black
218218
# local git="$(is_on_git && [[ -n $(timeout 1 git branch 2> /dev/null) ]] && echo :)${bold}$(parse_git_branch)${norm}"
@@ -233,7 +233,7 @@ else
233233

234234
# echo 'setprompt ran?'
235235
PS1_PREV_EXIT_CODE="\`echo -n '\[$ESC' ; if [ \$retcode = 0 ]; then echo -n '[0;32m'; else echo -n '[0;31m'; fi ; echo -n '\]' ; echo -n \$retcode\`"
236-
PS1_PRE="#$PS1_PREV_EXIT_CODE\[$ESC[0m\]"'-\j-\t, \d '$(colorizeprompt)":\\w"
236+
PS1_PRE="#$PS1_PREV_EXIT_CODE\[${ESC}[0m\]"'-\j-\t, \d '$(colorizeprompt)":\\w"
237237
#$git
238238
PS1_POST=" ($shell"')\n'"${bold}"': \!,\#;'"${norm} "
239239
GIT_PROMPT_START_USER="$PS1_PRE"

files/tree/etc/bash.bashrc.d/setup-aliases.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ function setup_aliases() {
7575
function validate_erb { erb -P -x -T '-' $1 | ruby -c ; }
7676

7777
function l-() {
78+
# shellcheck disable=SC2145 # incorrect interpretation of what the code is successfully doing: prepending "-" to to only the first of set of args provided
7879
command ls -lA $enablecolor -"$@"
7980
}
8081
function ls-() {
82+
# shellcheck disable=SC2145 # incorrect interpretation of what the code is successfully doing: prepending "-" to to only the first of set of args provided
8183
command ls $enablecolor -"$@"
8284
}
8385

0 commit comments

Comments
 (0)