pull/58/head v2.4.11-rc5
Simon Let 6 years ago
parent d2cc85a2fb
commit d3b1b84d38
  1. 4
      scripts/hooks.sh
  2. 6
      scripts/util.sh

@ -42,10 +42,10 @@ __resh_collect() {
#__RESH_GIT_TOPLEVEL="$(git rev-parse --show-toplevel)"
#__RESH_GIT_TOPLEVEL_EXIT_CODE=$?
if [ -n "$ZSH_VERSION" ]; then
if [ -n "${ZSH_VERSION-}" ]; then
# assume Zsh
local __RESH_PID="$$" # current pid
elif [ -n "$BASH_VERSION" ]; then
elif [ -n "${BASH_VERSION-}" ]; then
# assume Bash
if [ "${BASH_VERSINFO[0]}" -ge "4" ]; then
# $BASHPID is only available in bash4+

@ -9,7 +9,13 @@ __resh_get_pid() {
local __RESH_PID="$$" # current pid
elif [ -n "${BASH_VERSION-}" ]; then
# assume Bash
if [ "${BASH_VERSINFO[0]}" -ge "4" ]; then
# $BASHPID is only available in bash4+
# $$ is fairly similar so it should not be an issue
local __RESH_PID="$BASHPID" # current pid
else
local __RESH_PID="$$" # current pid
fi
fi
echo "$__RESH_PID"
}

Loading…
Cancel
Save