mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-12 17:20:40 +01:00
batgrep: Remove hardcoded reference to ripgrep executable
This commit is contained in:
parent
40a66d934d
commit
a6a1e55522
@ -8,10 +8,13 @@
|
|||||||
if [[ -z "$__LIB_CONSTANTS_INITIALIZED" ]]; then
|
if [[ -z "$__LIB_CONSTANTS_INITIALIZED" ]]; then
|
||||||
__LIB_CONSTANTS_INITIALIZED=true
|
__LIB_CONSTANTS_INITIALIZED=true
|
||||||
|
|
||||||
# Constants
|
# Constants: Executables
|
||||||
EXECUTABLE_BAT="$(command -v bat 2>/dev/null || command -v batcat 2>/dev/null || echo "bat")"
|
EXECUTABLE_BAT="$(command -v bat 2>/dev/null || command -v batcat 2>/dev/null || echo "bat")"
|
||||||
EXECUTABLE_GIT="git"
|
EXECUTABLE_GIT="git"
|
||||||
EXECUTABLE_DELTA="delta"
|
EXECUTABLE_DELTA="delta"
|
||||||
|
EXECUTABLE_RIPGREP="rg"
|
||||||
|
|
||||||
|
# Constants: Program
|
||||||
PROGRAM="$(basename "$0" .sh)"
|
PROGRAM="$(basename "$0" .sh)"
|
||||||
PROGRAM_HOMEPAGE="https://github.com/eth-p/bat-extras"
|
PROGRAM_HOMEPAGE="https://github.com/eth-p/bat-extras"
|
||||||
PROGRAM_COPYRIGHT="Copyright (C) 2019-2020 eth-p | MIT License"
|
PROGRAM_COPYRIGHT="Copyright (C) 2019-2020 eth-p | MIT License"
|
||||||
|
@ -257,10 +257,10 @@ main() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if "$READ_FROM_STDIN"; then
|
if "$READ_FROM_STDIN"; then
|
||||||
rg "${COMMON_RG_ARGS[@]}" <<< "$STDIN_DATA"
|
"$EXECUTABLE_RIPGREP" "${COMMON_RG_ARGS[@]}" <<< "$STDIN_DATA"
|
||||||
return $?
|
return $?
|
||||||
else
|
else
|
||||||
rg "${COMMON_RG_ARGS[@]}"
|
"$EXECUTABLE_RIPGREP" "${COMMON_RG_ARGS[@]}"
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user