Skip to content

Commit

Permalink
Check for host=auto after the settings are parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyandrew authored and sorbits committed Aug 14, 2012
1 parent 54f9091 commit 3085a94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rmate
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require 'optparse'
require 'socket'
require 'fileutils'

VERSION_STRING = 'rmate version 1.3 (2011-10-18)'
VERSION_STRING = 'rmate version 1.4 (2012-08-14)'

class Settings
attr_accessor :host, :port, :wait, :force, :verbose
Expand All @@ -19,16 +19,16 @@ class Settings
@host = ENV['RMATE_HOST'].to_s if ENV.has_key? 'RMATE_HOST'
@port = ENV['RMATE_PORT'].to_i if ENV.has_key? 'RMATE_PORT'

if @host == 'auto' and (conn = ENV['SSH_CONNECTION'])
@host = conn.split(' ').first
end

@wait = false
@force = false
@verbose = false

read_disk_settings
parse_cli_options

if @host == 'auto' and (conn = ENV['SSH_CONNECTION'])
@host = conn.split(' ').first
end
end

def read_disk_settings
Expand Down

0 comments on commit 3085a94

Please sign in to comment.