Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS fix #602

Merged
merged 1 commit into from Dec 8, 2018
Merged

macOS fix #602

Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

macOS fix

macOS’s BSD readlink is different from GNU readlink, says: illegal option -- f
  • Loading branch information...
zeilen committed Dec 4, 2018
commit ae20cdcf048b7ea904567061e06f4d5be30f6c0b
@@ -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}')
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.