diff --git a/CHANGELOG b/CHANGELOG index afe79844..31dd4f5f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Remove trailing newlines from commands to prevent trailing backslash #2141 + * Default parameters work correctly with the generator #2218 [Scott Barron] * Attempt to require 'rubygems' explicitly when running the switchtower utility #2134 diff --git a/lib/switchtower/command.rb b/lib/switchtower/command.rb index 807958fd..2ab6d249 100644 --- a/lib/switchtower/command.rb +++ b/lib/switchtower/command.rb @@ -7,7 +7,7 @@ module SwitchTower def initialize(servers, command, callback, options, actor) #:nodoc: @servers = servers - @command = command.gsub(/\r?\n/, "\\\n") + @command = command.strip.gsub(/\r?\n/, "\\\n") @callback = callback @options = options @actor = actor