mirror of
https://github.com/KittyKatt/screenFetch.git
synced 2026-01-09 22:37:57 -05:00
macOS fix
macOS’s BSD readlink is different from GNU readlink, says: illegal option -- f
This commit is contained in:
@@ -1795,14 +1795,14 @@ detectshell_ver () {
|
||||
detectshell () {
|
||||
if [[ ! "${shell_type}" ]]; then
|
||||
if [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" || "${distro}" == "Haiku" || "${distro}" == "Alpine Linux" ||
|
||||
"${distro}" == "TinyCore" || "${distro}" == "Raspbian" || "${OSTYPE}" == "gnu" ]]; then
|
||||
"${distro}" == "Mac OS X" || "${distro}" == "TinyCore" || "${distro}" == "Raspbian" || "${OSTYPE}" == "gnu" ]]; then
|
||||
shell_type=$(echo "$SHELL" | awk -F'/' '{print $NF}')
|
||||
elif readlink -f "$SHELL" 2>&1 | grep -q -i 'busybox'; then
|
||||
shell_type="BusyBox"
|
||||
else
|
||||
if [[ "${OSTYPE}" =~ "linux" ]]; then
|
||||
shell_type=$(tr '\0' '\n' </proc/$PPID/cmdline | head -1)
|
||||
elif [[ "${distro}" == "Mac OS X" || "${distro}" =~ "BSD" ]]; then
|
||||
elif [[ "${distro}" =~ "BSD" ]]; then
|
||||
shell_type=$(ps -p $PPID -o command | tail -1)
|
||||
else
|
||||
shell_type=$(ps -p "$(ps -p $PPID | awk '$1 !~ /PID/ {print $1}')" | awk 'FNR>1 {print $1}')
|
||||
|
||||
Reference in New Issue
Block a user