Skip to content

Commit e8e9024

Browse files
authored
Fix indentation and remove trailing semicolons (#165)
1 parent 8926de0 commit e8e9024

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

bash-preexec.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# Make sure this is bash that's running and return otherwise.
3939
# Use POSIX syntax for this line:
4040
if [ -z "${BASH_VERSION-}" ]; then
41-
return 1;
41+
return 1
4242
fi
4343

4444
# We only support Bash 3.1+.
@@ -76,13 +76,13 @@ __bp_install_string=$'__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_in
7676
# Fails if any of the given variables are readonly
7777
# Reference https://stackoverflow.com/a/4441178
7878
__bp_require_not_readonly() {
79-
local var
80-
for var; do
81-
if ! ( unset "$var" 2> /dev/null ); then
82-
echo "bash-preexec requires write access to ${var}" >&2
83-
return 1
84-
fi
85-
done
79+
local var
80+
for var; do
81+
if ! ( unset "$var" 2> /dev/null ); then
82+
echo "bash-preexec requires write access to ${var}" >&2
83+
return 1
84+
fi
85+
done
8686
}
8787

8888
# Remove ignorespace and or replace ignoreboth from HISTCONTROL
@@ -95,7 +95,7 @@ __bp_adjust_histcontrol() {
9595
# Replace ignoreboth with ignoredups
9696
if [[ "$histcontrol" == *"ignoreboth"* ]]; then
9797
histcontrol="ignoredups:${histcontrol//ignoreboth}"
98-
fi;
98+
fi
9999
export HISTCONTROL="$histcontrol"
100100
}
101101

@@ -136,7 +136,7 @@ __bp_sanitize_string() {
136136
# It sets a variable to indicate that the prompt was just displayed,
137137
# to allow the DEBUG trap to know that the next command is likely interactive.
138138
__bp_interactive_mode() {
139-
__bp_preexec_interactive_mode="on";
139+
__bp_preexec_interactive_mode="on"
140140
}
141141

142142

@@ -154,7 +154,7 @@ __bp_precmd_invoke_cmd() {
154154
# prompt command" by another precmd execution loop. This avoids infinite
155155
# recursion.
156156
if (( __bp_inside_precmd > 0 )); then
157-
return
157+
return
158158
fi
159159
local __bp_inside_precmd=1
160160

@@ -211,7 +211,7 @@ __bp_preexec_invoke_exec() {
211211
__bp_last_argument_prev_command="${1:-}"
212212
# Don't invoke preexecs if we are inside of another preexec.
213213
if (( __bp_inside_preexec > 0 )); then
214-
return
214+
return
215215
fi
216216
local __bp_inside_preexec=1
217217

@@ -291,7 +291,7 @@ __bp_preexec_invoke_exec() {
291291
__bp_install() {
292292
# Exit if we already have this installed.
293293
if [[ "${PROMPT_COMMAND[*]:-}" == *"__bp_precmd_invoke_cmd"* ]]; then
294-
return 1;
294+
return 1
295295
fi
296296

297297
trap '__bp_preexec_invoke_exec "$_"' DEBUG
@@ -304,7 +304,7 @@ __bp_install() {
304304
unset __bp_trap_string
305305
if [[ -n "$prior_trap" ]]; then
306306
eval '__bp_original_debug_trap() {
307-
'"$prior_trap"'
307+
'"$prior_trap"'
308308
}'
309309
preexec_functions+=(__bp_original_debug_trap)
310310
fi
@@ -321,7 +321,7 @@ __bp_install() {
321321
# Set so debug trap will work be invoked in subshells.
322322
set -o functrace > /dev/null 2>&1
323323
shopt -s extdebug > /dev/null 2>&1
324-
fi;
324+
fi
325325

326326
local existing_prompt_command
327327
# Remove setting our trap install string and sanitize the existing prompt command string
@@ -369,12 +369,12 @@ __bp_install_after_session_init() {
369369
if [[ -n "$sanitized_prompt_command" ]]; then
370370
# shellcheck disable=SC2178 # PROMPT_COMMAND is not an array in bash <= 5.0
371371
PROMPT_COMMAND=${sanitized_prompt_command}$'\n'
372-
fi;
372+
fi
373373
# shellcheck disable=SC2179 # PROMPT_COMMAND is not an array in bash <= 5.0
374374
PROMPT_COMMAND+=${__bp_install_string}
375375
}
376376

377377
# Run our install so long as we're not delaying it.
378378
if [[ -z "${__bp_delay_install:-}" ]]; then
379379
__bp_install_after_session_init
380-
fi;
380+
fi

0 commit comments

Comments
 (0)