mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-05 01:16:59 +00:00
neofetch: only fork for {BASH,OIL}_VERSION when necessary
This commit is contained in:
11
neofetch
11
neofetch
@@ -33,7 +33,6 @@ version=7.0.0
|
|||||||
if [[ "$BASH_VERSION" ]]; then
|
if [[ "$BASH_VERSION" ]]; then
|
||||||
bash_version=${BASH_VERSION/.*}
|
bash_version=${BASH_VERSION/.*}
|
||||||
else
|
else
|
||||||
BASH_VERSION=$(bash -c "printf %s \"\$BASH_VERSION\"")
|
|
||||||
bash_version=5
|
bash_version=5
|
||||||
shopt -s eval_unsafe_arith
|
shopt -s eval_unsafe_arith
|
||||||
fi
|
fi
|
||||||
@@ -1590,7 +1589,11 @@ get_shell() {
|
|||||||
[[ $shell_version != on ]] && return
|
[[ $shell_version != on ]] && return
|
||||||
|
|
||||||
case ${shell_name:=${SHELL##*/}} in
|
case ${shell_name:=${SHELL##*/}} in
|
||||||
bash) shell+=${BASH_VERSION/-*} ;;
|
bash)
|
||||||
|
[[ $BASH_VERSION ]] ||
|
||||||
|
BASH_VERSION=$("$SHELL" -c "printf %s \"\$BASH_VERSION\"")
|
||||||
|
shell+=${BASH_VERSION/-*}
|
||||||
|
;;
|
||||||
|
|
||||||
sh|ash|dash) ;;
|
sh|ash|dash) ;;
|
||||||
|
|
||||||
@@ -1601,7 +1604,11 @@ get_shell() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
osh)
|
osh)
|
||||||
|
if [[ $OIL_VERSION ]]; then
|
||||||
|
shell+=$OIL_VERSION
|
||||||
|
else
|
||||||
shell+=$("$SHELL" -c "printf %s \"\$OIL_VERSION\"")
|
shell+=$("$SHELL" -c "printf %s \"\$OIL_VERSION\"")
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
tcsh)
|
tcsh)
|
||||||
|
Reference in New Issue
Block a user