if (( $+commands[yarn] )); then
  export PATH="`yarn global bin`:$PATH"
fi

if (( $+commands[yarn] )); then
  local YARN_BIN="$(yarn global bin 2>/dev/null)"
  export PATH="$YARN_BIN:$PATH"
fi

Hide `yarn global bin` deprecation warning
Hide `yarn global bin` deprecation warning
