This reverts commit 2c8ee40566.
- _Shellcheck_ documentation for the [`source-path`]( https://github.com/koalaman/shellcheck/wiki/Directive#source-path ) directive indicates this is correct usage. We're `source`ing the `bash-preexec.sh` file from inside the `vendor/github.com/rcaloras/bash-preexec` directory. If we used the [`source`]( https://github.com/koalaman/shellcheck/wiki/Directive#source ) directive, then the full complete path to the file itself would need to be specified.
- Fix `disable=1090` to `disable=SC1090` and remove duplicate lines since this `shellcheck` directive will apply to the entire if-ladder.
- Disabling `SC2154` is almost never appropriate. In this case, several `_git_bash_completion*` variables are expressly assigned in this file, so there is no "unknown" to ignore.
Aside: the `${!_git_bash_completion@}` construct will expand to all variables starting with the previx `_git_bash_completion`, so this line is just a shorthand way to clear all our variables concisely without forgetting any.
26 lines
752 B
Bash
26 lines
752 B
Bash
# shellcheck shell=bash
|
|
# shellcheck disable=SC2034
|
|
#
|
|
# Load the `bash-preexec.sh` library, and define helper functions
|
|
|
|
## Prepare, load, fix, and install `bash-preexec.sh`
|
|
|
|
# Disable immediate `$PROMPT_COMMAND` modification
|
|
__bp_delay_install="delayed"
|
|
|
|
# shellcheck source-path=SCRIPTDIR/../github.com/rcaloras/bash-preexec
|
|
source "${BASH_IT?}/vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh"
|
|
|
|
# Block damanaging user's `$HISTCONTROL`
|
|
function __bp_adjust_histcontrol() { :; }
|
|
|
|
# Don't fail on readonly variables
|
|
function __bp_require_not_readonly() { :; }
|
|
|
|
# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040
|
|
__bp_enable_subshells= # blank
|
|
set +T
|
|
|
|
# Modify `$PROMPT_COMMAND` now
|
|
__bp_install_after_session_init
|