lib/veewee/provider/core/box/wincp.rb in veewee-0.3.7 vs lib/veewee/provider/core/box/wincp.rb in veewee-0.3.9

- old
+ new

@@ -5,25 +5,25 @@ module BoxCommand def wincp(localfile,remotefile,options={}) raise Veewee::Error,"Box is not running" unless self.running? + if self.exec("cmd.exe /C dir #{wget_vbs_file} > NUL",{:exitcode=>"*"}).status != 0 + env.ui.warn "Creating wget.vbs" + create_wget_vbs_command do |command_chunk, chunk_num| + self.exec("cmd.exe /C echo \"Rendering '#{wget_vbs_file}' chunk #{chunk_num}\" && #{command_chunk}") + end + end + + # Calculate an available kickstart port which we will use for wincp definition.kickstart_port = "7000" if definition.kickstart_port.nil? guessed_port=guess_free_port(definition.kickstart_port.to_i,7199).to_s if guessed_port.to_s!=definition.kickstart_port env.ui.warn "Changing wincp port from #{definition.kickstart_port} to #{guessed_port}" definition.kickstart_port=guessed_port.to_s end - if self.exec("cmd.exe /C dir #{wget_vbs_file} > %TEMP%\\null",{:exitcode=>"*"}).status != 0 - env.ui.warn "Creating wget.vbs" - create_wget_vbs_command do |command_chunk, chunk_num| - self.exec("cmd.exe /C echo \"Rendering '#{wget_vbs_file}' chunk #{chunk_num}\" && #{command_chunk}") - end - end - - env.ui.warn "Spinning up a wait_for_http_request on http://#{host_ip_as_seen_by_guest}:#{definition.kickstart_port}#{localfile}" webthread=allow_for_http_request(localfile,{ :port => definition.kickstart_port, :host => definition.kickstart_ip, :timeout => definition.kickstart_timeout,