Do not hardcode $SHELL path for bash (#260)

Some systems do not have /bin/bash. e.g., Alpine and NixOS. This change reads
the path dynamically via `which`. It solves the error `fork/exec /bin/bash`.
This commit is contained in:
Changsheng Wu 2022-12-15 03:34:11 -05:00 committed by GitHub
parent f8c0edfc17
commit 8ca463b5c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,8 +12,11 @@
# This gives users the choice to set aliases inside of their git config instead
# of their shell config if they prefer.
# Set shell for fzf preview commands
SHELL=/bin/bash
# Disable shellcheck for "which", because it suggests "command -v xxx" instead,
# which is not a working replacement.
# See https://github.com/koalaman/shellcheck/issues/1162
# shellcheck disable=2230
SHELL="$(which bash)" # Set shell for fzf preview commands
# Get absolute forgit path
FORGIT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/$(basename -- "${BASH_SOURCE[0]}")