Skip to content

Commit

Permalink
FIXED: when supply '--host auto' on command line it does not work
Browse files Browse the repository at this point in the history
The $host were initialized by default by 'localhost' so checking $host before
processing command line args is useless
  • Loading branch information
KES777 committed Sep 14, 2015
1 parent 9198633 commit e7b28ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rmate
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ done
host="${RMATE_HOST:-$host}"
port="${RMATE_PORT:-$port}"

if [[ "$host" = "auto" && "$SSH_CONNECTION" != "" ]]; then
host=${SSH_CONNECTION%% *}
fi

# misc initialization
filepath=""
Expand Down Expand Up @@ -201,6 +198,11 @@ while test "${1:0:1}" = "-"; do
shift
done

if [[ "$host" = "auto" && "$SSH_CONNECTION" != "" ]]; then
host=${SSH_CONNECTION%% *}
fi


filepath="$1"

if [ "$filepath" = "" ]; then
Expand Down

0 comments on commit e7b28ea

Please sign in to comment.